Powershell

Powershell cmdlets or commands have to be in verb-noun format. Ex: get-command

get-command -noun service // returns cmdlets with noun as service

To get help with a cmdlet

get-help <cmdlet>
get-help get-service
get-help new-service
Get-Help <cmdlet> -Detailed
Get-Help <cmdlet> -Full
Get-Help <cmdlet> -Examples
Get-Help <cmdlet> -ex
Get-Help <cmdlet> -Parameter *
Get-Help <cmdlet> -Parameter Name
    
help <cmdlet>
help new-service

In PS, all cmdlets return output as objects. Each object has methods and properties.

Get-Member \\ Gets the properties and methods of objects.

get-process \\ list all process
get-process -IncludeUserName
get-process <processname>
get-process -name WhatsApp | Get-Member
get-process -name WhatsApp | Select-Object *

Variables

variables can be defined with $ sign

Storing objects inside variables and accessing the method of those stored objects

Last updated

Was this helpful?