Getting Help and Finding Commands Part 1

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 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.

Let's talk about pipeline just for a second. A pipeline allows you to combine commands by taking the output of one command and using that as the input of another command. Okay, Accept pipeline input? So this is asking a question, will the get-service command accept pipeline input from another command? And the answer is yes or true.

OK go ahead and clear our screen.

·        And let's take a look at one more. This one is going to be online, so we want to type get-help again press return get-service, and this time we want to type hyphen and then online. Now watch what happens here. This is really cool. OK, here we go to the Microsoft site. This is online help. This is all your commands right here right here to the left, and you can just pick any command and get the help that you need.

Look to get-service we're very familiar with that one, aren't we? Okay. There’s description. And this is all online help. Look what you have at your fingertips. Who needs Google when you have this right.

Okay, thanks for watching and we'll see you in the next lecture.

Here is a list of all four parameters.

·        -examples – Basically gives you examples only. 11 examples really makes learning PS much easier.

·        -detailed – Syntax, parameters, examples

·        -full – Syntax, parameters, pipeline, aliases, examples, related links

·        -online – Takes you to the on-line help page

Complete and Continue  
Discussion

0 comments