Get-Help

You will be able to understand how to perform each and every command available in PS using the help command. Before using PowerShell help you have to update the help with the latest update. Update help is the new feature available in PowerShell 3.0. Not available in the previous version of PS. Update-help is the command used to update the help content. I am giving some examples for updating help.

PowerShell 3.0 Updateable Help.
Below is the command to update help directly from the Internet.

Update-help -force

I always recommend updating the PowerShell as it gives more detailed help as well as examples of cmdlets, so we can use the PowerShell itself as a guide for understanding the commands.

We need to run PowerShell as “Run as Administrator” (As the files will be stored under the root file which is restricted by default) to perform the update

‘Get-help Update-help’ command provides more details about how to update help

Force is using to update the help file forcefully.

We can save the help file using the save-help cmdlet. This will allows you to download the newest help files for Windows PowerShell and save in a specified directory. This feature lets you update the help file on the computer that does not have Internet availability.

Below is the cmdlet used to save the help files and update them from the saved place. We have to specify the UI Culture while downloading the help files. (Get-UICulture is the command to get the UICulture of the system)

Save-Help -UICulture en-US -DestinationPath C:UsersvivekPSHelp -Verbose
Update-Help -SourcePath C:UsersvivekPSHelp -Verbose

Get-Command

Can you remember all the cmdlets in Powershell ???

If NO, get-command will help you to retrieve all the available PowerShell commands. If you remember any words in the command, you can easily retrieve the command. But it will not display the additional parameters and display all the commands in the console by default.

# Out-GridView: This cmdlet will display the output in  different windows and will help you to read it properly

Get-Command Get-Help
Get-command get-exe*

Get-member

Get-Member is an essential command for discovering more about PowerShell objects. As you can see, PowerShell output shows us some of the default properties, not all. We can use the get-member cmdlet to retrieve all the properties of an object. Moreover, we will be getting all the methods of an object by using get-member.

Get-Process | Get-Member

GM is the alias for Get-Member

A cmdlet always consists of a verb and a noun, separated with a hyphen. Some of the verbs use for you to learn PowerShell is:

Get — To get something
Start — To run something
Out — To output something
Stop — To stop something that is running
Set — To define something
New — To create something

PowerShell’s execution policy 

PowerShell’s execution policy is a safety feature that controls the conditions under which PowerShell loads configuration files and runs scripts. This feature helps prevent the execution of malicious scripts.

Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode.
AllSigned – Only scripts signed by a trusted publisher can be run.
RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run.
Unrestricted – No restrictions; all scripts can be run.