PowerShell: Getting Started - Michael Bender Flashcards
What is Windows PowerShell?
It’s an execution engine that provides the ability for you to interface with your environment using a variety of tools
What does PowerShell ISE stand for?
Integrated Scripting Environment
What are the commands to see a directory?
ls, dir
How do you clear a screen?
cls
What is the command for finding services?
get-service
What command do you use to filter the information?
where-object, then the condition you require.
eg. get-service | where-object status -eq ‘stopped’
How do you export your results to a CSV file or txt file?
export-csv C:/powershell/services.ps1
out-file C:/powershell/services.txt
What is the syntax to request PowerShell to open a .ps1 script via notepad?
First, type notepad then the location of the file.
eg. notepad c:/powershell/services.ps1
What is the command to find more commands available in PowerShell?
Get-command
How do you change the fonts and the size of PowerShell Window?
Right click on the title of PowerShell box and choose properties
What is the command to find more commands available in PowerShell?
Get-command
How do you change the fonts and the size of PowerShell Window?
Right click on the title of PowerShell box and choose properties
What is the syntax for:
- Get Service
- Status: Stopped
- only display name, displayname and status
- Export to CSV
get-service | Where-Object {$_.status -eq “stopped”} |select-object status,name,displayname|Export-Csv C:\PowerShell\services2.ps1
Please explain the concept of “Verb - Noun” in PowerShell?
“Do Something - To Something”
Get-Verb
How can you find:
- Service
- Name starting with M
- on a specific computer/s
Get-service -name m* -ComputerName PC1,DC1