Idera nSoftware Compellent

February 2009 - Windows PowerShell Team Blog

  • Converting to Array

    When you run a PowerShell pipeline, that pipeline might return 0, 1 or many items. If you are assigning the results of that pipeline to a variable, you will get $null, 1 item or an array of items respectively. Sometimes, you won't care about the different types returned, but at other times, you'll actually prefer to force the results to always be an array. In those cases, you can use @( .....
  • Stopping Every Instance of PowerShell.exe (except the one I'm in)

    Our Test Architect just dropped by my office and pitched me a PowerShell question with a nice, quick answer. He wanted to stop every process of a particular name, except for the instance that was running the script. You can do this in one nice pipeline: Get-Process Powershell  | Where-Object { $_.ID -ne $pid } | Stop-Process Get-Process takes a positional parameter (name), which is a wildcard...
  • JAOO Talk

    Last year I was delighted to be invited to give a talk at JAOO conference.  This is a great language conference.  The thing I was delighted to discover is that the while it had Microsoft content (AndersH gave one of the keynotes), the bulk of the people and content was non-Microsoft.  This allowed me to give a different kind of a talk.  It allowed me to go back to the basics and...
  • #requires your scripts

    Recently, I saw someone that had developed a script on the CTP3 drop and was then having trouble running it on v1 of PowerShell. Eventually it turned out that he was using v2 features in his script. Most of you know that we are trying to keep the next version of PowerShell compatible with v1 and I encourage you to report any problems that you might have in that area. Unfortunately, v2 being compatible...
  • Diff between Windows PowerShell versions

    PowerShell MVP Oisín Grehan has done a really good job in getting the diff between PowerShell releases. V1 and CTP3 http://www.nivot.org/2009/02/04/DifferencesBetweenPowerShell10RTMAndPowershell20CTP3Win7Beta.aspx CTP2 and CTP3 http://www.nivot.org/2008/12/23/PowerShell20CTP3HasArrived.aspx Thanks a lot Oisín. Osama Sajid [MSFT] Read More...
  • Console Application (Non) Support in the ISE

    There are some limitations on how the ISE interacts with console applications you need to be aware of, for apps like ftp and netsh. First of all, the ISE Runs console apps that don’t require user input just fine. For example, “ping www.microsoft.com” and “cmd /c dir /s” Piping also works fine in the ISE, For example, PS C:\Users\ibrar> "show mode" | netsh netsh>online Automation in...
Copyright 2010 PowerShell.com. All rights reserved.