Transcript for:
Customizing PowerShell for Effective Use

One of the first things you're going to do with PowerShell before you really start using it is get the environment customized. To do that, open a copy of the shell, move up to the little control box there and select properties. Now, if you've decided that you're going to use the ISE, and that's fine, although I kind of don't recommend that you dive into the ISE until we get to about chapter 12, 13 or so. Just because having the command line experience is certainly valuable. However, I'm going to get that up and running too, because there's some customization you'll want to do to the ISE. So within the console, the two things you're going to want to do are, first of all, adjust the font size. Now, I like to use the Consulus font, and I like to have it at a... And there comes the ISE. Let's just get him out of the way for a second. I like to have the Consulus font at a pretty decent font size, and I'm going to show you why in just a second. The other thing you're going to want to do is get over here onto the Layout tab. Now, this is kind of important. You're going to want to adjust the window size so that it isn't any wider than your physical screen. So if you've got it like this and you see that little horizontal scroll bar show up, bring that down a little until it fits within the screen like it's doing now. Then go up and make the screen buffer size match. And if you look at this horizontal scroll bar, now it's gone. The reason you want to do that, let me get out of here, is because, and you'll probably want to adjust the height of the window too so that it can fit completely within your screen. The reason you want to do that is because if you've got this horizontal scroll bar, a lot of PowerShell's layout that we're going to see will try to right justify numbers. And if you've got your horizontal scroll bar, then what's going to happen is it's going to look like your commands had no output. It's going to look blank because the output is all... off to the right side and you'll have to scroll horizontally. So by getting rid of that horizontal scroll bar, it'll just make your life kind of a little easier. So now that you've gotten that adjusted, oh, and I need to show you why the font size is important, you need to make sure that as you're using the shell, you can clearly distinguish between that, which is an apostrophe or a single quote character. It's on a US keyboard on the key right next to your return key, and that, which is a back tick. And on a US keyboard... that's usually right under the escape key. You need to be able to clearly distinguish between those, and the font size can be just as important in helping you do that as the font you choose. The other characters that are important is the number 1 and a lowercase l. Make sure that you can clearly distinguish between those things at the command line. You're also going to want to make sure that you can clearly distinguish between a curly bracket or curly brace, a parentheses, and a square bracket. If you can get all of those things visually clear, then you're going to do much better in the shell. So with that out of the way, let's just take a real quick look at the one couple of bits of customization that you might want to do in the Windows PowerShell ISE, or Integrated Scripting Environment. So let's get that up and running here. Here it comes. Now, again... Pretty much font size is the important thing. The ISE doesn't actually give you an option to customize the font face, but to customize the font size, you're going to come down here to the lower right-hand corner of the window and just adjust this slider, and you can see over here I'm getting my font size a little bit bigger. Now, within the ISE, you've got three different panes. This one over here is the script pane. This is your output, and this is where you're going to interactively type commands. You can use these arrows to rearrange the panes if you want to, or you can collapse it completely and get yourself a little bit more room for using this interactively. Now, typically, what most folks like is to have a nice big output area, just a line or so for the actual command you're typing, and you can use these toolbar buttons to also create the type of layout that you want to see. So we've got the three panes here. I can collapse the script pane. and just get down to my ISE command line mode. So that way when you run a command, you've got a lot of room to actually look at the output of it. So once you're all set up, you should be ready to go.