While using CMD.exe, I got into a number of bad habits. One of those is the habit of eliminating whitespace for various commands. The problem is that that causes problems with PowerShell. More precisely stated – it doesn't work. Here is what you get:
PS> ipconfig/allThe term 'ipconfig/all' is not recognized as a cmdlet, function, operable pr...
If you haven't already installed PowerShell analyzer, you can now check out want it does by watching the video. Karl Prosser recently released a 7 minute video showing you a run-through (as opposed to a walk-through) of its features. Now that fact that he spends 7 minutes and has to run through the features should give you a bit of a clue as to ...
When you run Get-Alias, it shows you all the aliases currently available. You might want to know which aliases were Custom aliases. That is to say, which aliases did not come built in with PowerShell. So what does it take to answer this question?
With those 4 things in focus, you can answer the question:
PS> Compare-Object (Get-Alias) (PowerS...
Several people have asked recently about how to manage processes in PowerShell. This blog post should answer a number of those questions.
As one might expect from the "shell" part of PowerShell, you don't have to do special anything to start a process . In a programming language such as VBScript, you have to do something fairly complex like:
...
Kjartan posted the comment:
I really like reading your blog and have done so for a long time now, but since I mostly read blogs with the RSS-reader in IE7 the styling of the code samples makes the posts harder to read, for some reason IE7 (at least the version I'm using Vista RC1) dispays the styling as a big chunk of text and the ...
I picked up Jerry Lee Ford's book Microsoft Windows PowerShell Programming for the absolute beginner .
In the section on aliases, he warns users that Set-Alias does not verify the validity of the alias assignment. That is a good point. Here is a function that does that for you.
function Set-Alias-Strict($Name, $Value){...
In the newsgroup Microsoft.Public.Windows.PowerShell Marco Shaw asked about accessing data past the end of a defined array. He wondered why he didn't get an error.
As a general rule in PowerShell, when you ask for something that doesn't exist, you get an NULL not an error.
PS> $array=@(0,1,2)PS> if ($ar...
Did you realize that Format-Table had a parameter -GroupBy? This tells Format-Table to generate a series of tables instead of a single table. The best way to get this in focus is to show an example.
For the purposes of this blog entry, I'm going to use the aliases GSV for Get-Service and FT for Format-Table. Also, I do...
The information here relates to Windows PowerShell 1.0 installer on downlevel platforms (XP SP2, W2K3 SP1 and above).
The job of installers is to create an environment on a user’s machine, so that the underlying software works seamlessly on the machine. Typically most installation scripts copies some files and sets some registry keys. This appears ...
I wanted to follow up on Jeffrey's post and one of the comments. It has to do with this example:
The reason that we get a double rather than an int is because of precedence. The conversion has a higher precedence than the division operation, so what
really means is:
"Convert 1 to an integer and then divide by 2", which will result in a...