Archive for August, 2012
PowerShell Version 3 if..else bug
Posted by Karl Mitschke in Bug, V3 on August 21, 2012
Consider the following from PowerShell’s excellent help: Get-Help about_If 001002003004005006007008 if ($a -gt 2) { Write-Host “The value $a is greater than 2.”}else{ Write-Host “The value $a is less than or equal to 2, is not created or is not initialized.” } If you modify that example to tighten it up a bit, and make it look better you can cause the […]
Quick modification of the Compare-Command.ps1 script
Posted by Karl Mitschke in Uncategorized, V2, V3 on August 8, 2012
I found a few issues with my Compare-Command script, and have resolved them. If you have already downloaded it from TechNet, thanks, and you can just modify the following two lines: Line 72 becomes:$V3Detailed |select -ExpandProperty Parameters |ForEach-Object -Process {$V3Paramaters += (“$($_.Name)=$($_.ParameterType.name)=$($V3ModuleName[0])“)} Line 82, likewise, becomes:$V2Detailed |select -ExpandProperty Parameters |ForEach-Object -Process {$V2Paramaters += (“$($_.Name)=$($_.ParameterType.Split(“.”)[-1])=$($V2ModuleName[0]))”)} While […]
Quickly compare PowerShell V2 and V3 cmdlets
Posted by Karl Mitschke in V2, V3 on August 7, 2012
Recently, I was looking for the difference between the Get-ChildItem cmdlet in Version 2 and Version 3 of Windows PowerShell. Although you can Bing “PowerShell Get-ChildItem v3” and get an accurate listing of the new parameters from TechNet, that’s not true for all cmdlets, so I wrote a quick little script to find the information. […]