What is Powershell? PowerShell is a new command shell from Microsoft and yes it is a command prompt and scripting...
Command to know the version of Powershell
In the below example you will notice that the powershell version 3.0 is being displayed.
There are four categories of PowerShell commands:
PowerShell commands have been standardized using a “verb-noun” naming convention know as a cmdlet. This standard simplifies the learning curve and provides a better description of what the cmdlet does. To see a list of cmdlets available in PowerShell type the following cmdlet:
The “Name” column lists the cmdlets in the “verb-noun” naming convention.
To list all the commands that use a specific verb. The following command yields all cmdlets that use the verb “Set”
get-command -Verb Set <enter>
Try finding commands that use the verbs; Add, Clear, New, and Get.
Similarly you can use commands that use specific nouns. Type the following command to see which cmdlets use the noun “computer”
get-command -Noun computer <enter>
In learning new technologies, it is important to find information quickly and easily. Get-Help cmdlet has been designed for that purpose; this will be the most utilized cmdlet until you become more proficient.
Information about Get-Help cmdlet. Includes description, syntax, and remarks.
Information about all available help topics.
Information about a specific cmdlet.
Two other forms of the Get-Help cmdlet exist, the noun “Help” and the “-?” parameter. Help, by itself provides the same info as Get-Help *. Use Help with a cmdlet as follows, Help Get-Service. With the help parameter, Get-Service -?.
To know all the cmdlets associated with the noun Service
Get-command -noun service <enter>
To know what services are running on the computer Type cmdlet:
To know the status of a specific service Type:
Get-service -name Ampagent <enter>
To Start a particualr service Type:
Start-service -name Ampagent <enter>
To Stop a specific service Type:
stop-service -name Ampagent <enter>
In this example we are using Ampagent service.
This example should give you an idea on how to use cmdlets. start playing with different cmdlets to get more idea on them.