Powershell TutorialIntroduction 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 management
Introduction to windows powershellWindows power shell is the advanced version of shell for Windows Operating system. It is just like Linux Shell like BASH.Key features of Windows Powershell are given below.
- introduced with Windows 7
- super set of Windows Command Prompt
- based on .Net Framework
- COM and WMI automation
- Open Source
- WS (Web Service) Management and CIM (Common Information Model)
Getting helpTo get help on everything, you can execute below command.
Above command displays help terms from various categories like alias, Cmdlet, function, HelpFile. To get the help on all command lets
> get-help *
To get the help on all functions get-help -Category function
get-help -Category cmdlet
To get the help on all Help Files
get-help -Category provider
We can also use below command (Alias – gcm) to show the list of commands and functions.
get-help -Category helpfile
To display commands with specific name say xyz
“Get-Command” also allows you to search the commands using nouns or verbs.
> Get-Command *xyz*
To get examples and full information about specific command, you can use below syntax.
> Get-Command -noun Job
To update the help, you can use below command.
get-help <command-name> -online get-help <command-name> -full get-help <command-name> -examples
To get the list of all verbs, you can use below command.
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.
- .ps1 – Powershell script file
- .psd1 – data file
- .psm1 – Powershell Script module
Web development and Automation testing