View on GitHub

MyPowerShellJourney

Learn with me as I grow to master PowerShell scripting...

Basic syntax for Powershell

I will cover the topics.

Powershell Version

$PSVersionTable

Other options for getting strictly the version only. So you can use a dot (.) to access a specific property like PSVersion.listed.

$PSVersionTable.PSVersion

Comments

#Single line comment

<# Multi-line comment
Works
Like
This
#>

Current User

whoami

Three core cmdlets allow you delve into what cmdlets exist and what they do:

Get-Command: The Get-Command cmdlet lists all of the available cmdlets on your system. Filter the list to quickly find the command you need.
Get-Help: Use the Get-Help core cmdlet to invoke a built-in help system. Or use an alias help command to invoke Get-Help but improve the reading experience by paginating the response.
Get-Member: When you call a command, the response is an object that contains many properties. Use the Get-Member core cmdlet to drill down into that response and learn more about it.

** Get-Alias **
The Get-Alias cmdlet retrieves the aliases for previous shell commands and displays what the Powershell equivalent. This would be very useful if you are very familiar with using Command Prompt.

Get-Alias

Image

**Get-Help ** The Get-Help cmdlet provides a list of cmdlets and their functions.

cmdlets

Pipelines