5 PowerShell Starter Cmdlets

5 Powershell Starter Cmdlets

OK Really 6

PowerShell is a huge topic to try and tackle, but we’ve all got to start somewhere.  So I thought I’d offer up some basic cmdlets that can help you get started with PowerShell.  This is by no means a complete list, but it will get some data flowing through your shell and make you feel like you are making progress.

Get-Help

This is one cmdlet that Microsoft has really improved with recent versions of PowerShell.  It has a TON of information about every cmdlet you might run.  Even though the default is to usually run out and do a search on Google for the cmdlet you are looking for I would suggest starting with Get-Help.  You’d be surprised how much information it contains.

The basic use looks like this…

This will return all of the help information available for Get-Help, but wait there’s more!

If you combine Get-Help with another cmdlet (like the one’s below) it will show you the help for each of those cmdlets!

Get-Help of another cmdlet.

Get-Help of another cmdlet.

 

Get-Command

This is another “help” type cmdlet.  If you ever want to know what cmdlets are available to you at any given time then this is what you would run…

Get-Service

This cmdlet will return all of the services that are currently running on your computer/server.

It can be combined with other cmdlets to do a variety of things, but one of the most common is to start or stop a service.

BE CAREFUL if you run the Stop-Service cmdlet on a production server, because you may stop something you didn’t mean to!  FYI…If you do stop something you shouldn’t you can easily restart it with this cmdlet.

Import-CSV and Export-Csv

This may be one of the single most import cmdlets to learn to use.  PowerShell is all about getting information and doing something with that information.  One way we have to get information into and out of the Shell is through Import/Export-Csv.  Let’s say you had a list of servers that you wanted to run a script against, this is the cmdlet that you can use to import that list of servers and then DO something with them.  There are plenty of other ways to get information into your scripts, but this is probably one of the first you will use and ,for me, one of the most versitle.

Clip

Clip is one that I didn’t find out about for a while, but what a cool little cmdlet this is.  If you add this to ANY cmdlet it will copy the output of that cmdlet to the clipboard on your P.C.  From there all you have to do is paste it into your favorite text editor to view, edit and save the information.

 

As always your feedback is really appreciated so make sure to leave some comments!