Getting Help

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *

Already have an account? Sign In »

1 hour 43 minutes
Video Transcription
Hello, everyone. I'm instructor Gerry Roberts, and this is Power Shell scripting.
You know, sometimes when you're working in power show, you might need a little bit of assistance on this module. We're gonna talk about how to get that.
We're gonna talk about getting help in power show. We're gonna talk about the helps in tax, some information about parameters and piping till some helpful hints toe help you along your way. Then we're going to switch a little bit over two partial I s C.
And then last but not least, we're gonna talk about some additional help that you can get
getting help in Power Shell. There are three commands in power shell that you can actually use to get some help.
There's get Dash, help,
help and man
get dash Help is a built in CMG. Let that allows you to get information about a command.
Help is actually a built in function you can use to get information about command.
A man is actually Justin alias for help. Those exact same thing is help.
Only it's the Lenox friendly version. So if you're used to working in Lenox,
you have your man command. Here is well,
the syntax for help.
So when you run a help command, you actually get ah, couple different things that have returned about the command you're looking up.
There's a section in here called Syntax. This is actually very important because it helps you understand how to use to commit and how it's actually written out.
You'll see in the picture here.
There's a lot of stuff
you'll see Get Dash Command,
which was the one we looked for help for,
and you'll see a lot of different parameters and other things like dash name, dash, argument list and so forth.
Any items in the square brackets are considered parameters. So again, dash name dash argument list dash all etcetera
items, and the less than greater than brackets are objects or parameter values,
so you can see here under name. It can take a string so you could put in values in, say, words or sentences.
Items in the curlicue brackets are usually a list of items that could be valid parameters.
So if you look at command type,
you'll see you have, like alias function, filter all those other things that you can put it in there.
Items separated by a pipe, a representative of multiple items in the valid parameter list.
Thio again. When you look at command tight, you can see Alias function filter, etcetera that could all be valid values for that particular parameter For a couple other things about parameters.
Help documentation actually does include some more robust information, not just that. Little less there that could tell you about parameters are available.
This information helps. You better understand what the parameters are,
and that understanding does help you write better commands and scripts to do things you want to do.
If you want to see more information about a parameter
when you're doing the help command or the get help her man
at the end of the command, do the dash full switch,
and this will give you a lot more information. So some things you'll see when you pull up parameters how you'll actually see data type. This is just what kind of information it can take. For example, when we talked earlier about string, that just means it takes in a string of values such as a word sentence
That means you have to provide a value for that parameter in order for the command to work. So if it says required, yes, that means you need to put something there.
Position now. One of the things about commands in power Shell is in some cases, you don't have to provide the parameter name. If a value is provided in a certain position in the command,
the system automatically knows what that parameter is and doesn't need the name. Now that's not all commands,
Um, and not all parameters.
So be wary of that
default value. Sometimes Power Show will fill in a default value for a parameter. If there is one, it will show what is in the description and give you further information.
Another couple things here that have more to do with how the command works except pipeline input and accept wildcard characters. Pipeline input means whether or not you can actually pipe something with the command. Some commands don't let you use a pipe.
The wild card. Whether or not you can use wild cars for parameter values that could be like percentages or asterisks or things like that. In some cases, you can use wild cards that does help you find things. In other cases, it will let you use a wild card. Do you have to use the full value?
So what? Actually his A pipe? Wild cards were pretty easy to understand, but pipes are a little bit more complex when it comes to commands.
So, according to Microsoft pipelines, act like a series of connected segments of a pipe.
Items moving along the pipeline passed through each segment to create a pipeline and power shell. You connect the commands together with a pipe operator, which is that up and down line.
The output of each command is used as input for the next command. What is that all be? Basically, it just means pipes are going to allow you to use multiple commands together. Each command takes the output from the previous command. And an important thing here to understand is that command.
It's not gonna take
the text from the previous command. It's going to be the output from the previous command. For example, get dash printers,
space pipe space, F l.
The command there is going to get all of the printers then is going to format it in a list. So what will happen is that f l there that formatted list is gonna grab everything from get printers and make a pretty little list for you.
Some helpful hints when working in Power show
used the up barrow to numerator commands you previously done. This is very similar to some other command line systems. All you do is up or down, and you could scroll through what you've already written
used the clear Command to clear out your power show window. So if you type the word clear, it'll clear everything out and you'll start with a nice, clean power show window.
You can also use the tab key to complete commands or tab complete.
This is not 100% accurate. However, it's fairly accurate.
It works pretty similar. If you're used to like the Cisco IOS system are other systems like that where you start to type of command and you use the tab key. Now what it'll do on regular power shell is when you hit Tab and allow you to scroll through commands that are similar to what you're typing.
Now, when we get to Power Shell I S C.
It's a little different. There are actually some better helpful things.
Their first helpful item is the power show. Uh, intelligence. Now, if you've worked with visual studio or some other products, you might be familiar with intel. A sense basically is a code completion aid supposed to help you complete commands in a visual way instead of having to tab
they're using tab complete.
You can see on the right hand side here this picture, we're trying to get to command, and it shows us a list of what kind of get commands we can use when you start typing Maur. It actually does make the list shorter because it'll find what you are exactly starting to type.
Went on.
It's gonna display that list based on what you typed. So you can see there. I only type to get dash, so there's a whole lot of commands again. If I started typing a little more, that list would tighten up.
Another item is the command search. This is actually a really cool item that they have impartial. I s C. This allows you to search for a command through a list of commands. Pretty much you start typing the command as you can see here on the right, and they'll give you a nice little list.
This is nice, because if you can't remember exactly what a command is, you can actually type different words
in the command. It will find it. So instead of just intel, a sense that finds it based on what you've started typing. If you were to type just a work, for example here, if you were to type Alias, you would get a list of all the commands that had the word alias in it
instead of intelligence where you just did get Dash A and it found it that way.
So it's kind of very useful, allows you to do key. Words are just things like that, so you can find commands a little bit easier if you want to use it in I s C U Go to view and show command at on, and it shows up on the right. It's very useful.
Additional help with Power show
You do have about files that you can access in power show.
There's also a couple parameters. Show window and show command give you some more information about what you're working with,
and the Microsoft Docks website is super useful for getting help us. Well, that's https colon forward slash forward slash and docks that Microsoft dot com
Ford slash and Dash US for Tash Power Show. And again, if you're in another country,
go to your country's landing page for Microsoft documents, which is usually just stocks up Microsoft dot com and then type in power show, and it should bring you directly to the power shell page. All right, it's post assessment time. So if you wanted to get help
Ah, for the get a D group command, what command would you use?
Would you use help, get 80 group
man, get 80 group
or get
dash help get 80 group? Or would it be all of those above? You can go ahead and pause for a second,
and then once you're ready, we'll get the answer.
Answer is actually all of the above Help man and get dash help are all valid commands you can use to get information about a command.
So in this video, we talked a little bit about how to get help for power show
Up Next