Powershell Tutorial
Introduction to Powershell Managing History of Powershell Commands Cmdlet, Alias, Function and Module in Powershell PSDrive Profile in Windows Powershell Variable Management in Powershell Passing values to parameters from file Creating files and directories Basic File System commands Finding the patterns in files Unique command Replacing patterns in files Comparing objects Sorting objects Other object commands Getting members of an Object Managing processes Managing Jobs IO redirection Piping System Commands Network commands Service Commands WMI(Windows Management Instrumentation) CIM (Common Information Model) Formatting output exporting output XML processing Powershell Module Management Remote computer managementIntroduction to windows powershell
Windows power shell is the advanced version of shell for Windows Operating system. It is just like Linux Shell like BASH.
- introduced with Windows 7
- super set of Windows Command Prompt
- based on .Net Framework
- COM and WMI automation
- Cross-Platform
- Open Source
- WS (Web Service) Management and CIM (Common Information Model)
Getting help
To get help on everything, you can execute below command.
> get-help *
Above command displays help terms from various categories like alias, Cmdlet, function, HelpFile. To get the help on all command lets
get-help -Category cmdlet
To get the help on all functions get-help -Category function
get-help -Category provider
To get the help on all Help Files
get-help -Category helpfile
We can also use below command (Alias – gcm) to show the list of commands and functions.
> Get-Command
To display commands with specific name say xyz
> Get-Command *xyz*
“Get-Command” also allows you to search the commands using nouns or verbs.
> Get-Command -noun Job
To get examples and full information about specific command, you can use below syntax.
get-help <command-name> -online
get-help <command-name> -full
get-help <command-name> -examples
To update the help, you can use below command.
> update-help
To get the list of all verbs, you can use below command.
> Get-Verb
Understanding command syntax
“Get-Help” command shows the syntax of command. Looking at the syntax, we can figure out what parameters are positional, optional etc. It also shows the aliases for the command. As you can see in above image, there are many variations of Get-Process command. Anything in the [] is optional. string[] means that parameter takes array of strings. Also note that in the end it is saying [commonParameters]. Usually all commands can accept common parameters. Here is the list of common parameters.- verbose
- debug
- WarningAction
- ErrorAction
- ErrorVariable
- .ps1 – Powershell script file
- .psd1 – data file
- .psm1 – Powershell Script module

Web development and Automation testing
solutions delivered!!