Understanding the Powershell Platform Flashcards
Name the two Powershell “flavors”
The “Command Window” and ISE
Name the two Powershell “flavors”
The “Command Window” and ISE
What are the methods to retrieve a directory listing?
dir
ls
Get-ChildItem
The best way to customize the command window or ISE is via the…
Shortcut to the relevant program. This means that the changes will be remembered.
Command Window is useful for
Calling Scripts
Exploratory Work
ISE is useful for
Development
Powershell scripts have the extension
.ps1
Single line comments begin with a
#
Multiline comments begin and end with
Regions are denoted with
#region [Optional Title] #endregion [Optional Title]
How do you retrieve a list of all system cmdlets?
Get-Command
How do you retrieve a list of all system commands?
Get-Command
How do you retrieve a list of only cmdlets that have a noun of “Service”
Get-Command -noun “Service”
How do you get help for a given cmdlet
Get-Help [Cmdlet Name]
e.g. Get-Help Get-Command
Command Window is useful for
Calling Scripts
Exploratory Work
How do you see the online version of a help entry?
Get-Help [Command-Name] -online
What’s the shortcut for pulling up help?
Command-Name -?
Single line comments begin with a
#
Multiline comments begin and end with
How do we find which command a specific alias points to?
Get-Alias [alias]
All commandlets (cmdlet) are structured as
Verb-Noun
How do you retrieve a list of all system cmdlets?
Get-Command
How do you retrieve a list of only cmdlets that have a verb of “Get-“
Get-Command -verb “Get”
How do we set the current directory?
Set-Location “path\or\relative\path”