Author : HASSAN MD TAREQ | Updated : 2021/09/09
Command Structure
- PowerShell uses a Verb-Noun name pair to name cmdlets
- The verb identifies the action that the cmdlet performs
- the noun identifies the resource on which the cmdlet performs its action
- Example:
Get-Xxx
,Set-Xxx
#
# Get-Command cmdlet included in PowerShell is used to get all the cmdlets that are registered in the command shell
#
Get-Command
Get-Command -Noun Variable
#
# Getting help about cmdlet
#
# Get-Help <cmdlet-name>
#
Get-Help Start-Service -Full
Get-Help Start-Service -Parameter *
Variable in Script
- A variable is a unit of memory in which values are stored
- In PowerShell, variables begins with a dollar sign (
$
)
#
# User defined variable
#
$FooBarBaz = "foo-bar-baz"
#
# Automatic variable
#
$version = $PSVersionTable.PSVersion
Details: Variables in PowerShell