Getting Help and Finding Commands Part 1
- One of the GREATEST BENEFITS for those that are brand new to PowerShell is the help system. The Help System is where you’ll get all your answers. Why count on google, when you have something better right at your fingertips.
You might ask, why should I spend time learning about the help system?
- If you’re serious about learning PowerShell, you’ll need to be serious about spending time mastering the help system. We gonna be spending a lot of time using the help system, why? Because it’s the secret to becoming a PowerShell Expert.
- Commands vs. cmdlets vs. Functions. PowerShell has many types of commands. We ’ll refer to all these as commands. We’ll define what a cmdlet is and talk about functions later.
- CMDlets- Are unique to PowerShell. These commands allow you to get a specific task done. Cmdlet’s take the form of a VERB-NOUN. As you know a verb denotes an action. For example, Get, Add, Export, and Import.
Let’s take the command Get-Service, get is the verb and service is the noun.
Or the command Export-Csv – Export is the verb, and CSV is the noun.
The Verb-Noun format gives these commands some consistency, in other words, you’ll always know that any cmdlet will start with a verb and end with a noun.
There are Four different ways to examine the help system – examples, detailed, full and online. Lets go ahead and checkout all four. We’ll use get-help get-service as our command.
- OK go ahead and type get-help and press return, space. Get-service, okay and press return. Now press the spacebar once, press the hyphen key and type examples, ex. Then press return. OK press return again. And let's go ahead and scroll up. And as you can see we have example one, okay and scroll the whole way down. And here we have example 11. So as you can see we have 11 examples for get-service. And this really makes learning Power-Shell much easier.
·Okay now switch over to the other to my other screen. And type the same command and get-help, space get-service OK. Now this time press hyphen and type detailed. Ok, now press return now press return again. Now what you can see is again we have all 11 examples. But let's go ahead and scroll up and as you can see we have some different some different items.
- One is syntax and then we have description, and then we have parameters. Let's take a look at syntax. Basically, syntax helps us construct a command correctly. To construct a command, you follow the syntax from left to right. Okay, now description gives you a good description of the get-service cmdlet. Now let's take a look at parameters. Okay, the parameters of a command are options that determine what the command can do. Notice that parameters always start with a hyphen.
- OK, allright now let's go ahead and clear that screen. Now this time we'll type get-help, space get-service and this time type -full. All right let's take a look at that right now.
Again we have all the examples, and let's move up and see what we have that's different. Okay now here we have the name synopsis, syntax, description, and the parameters again. Notice these five items, they weren't included in the detailed help, four of these items we'll discuss in another lecture.
Sign up to access the rest of this lesson
You must either log in or sign up to access this lesson.