PowerShell Team

Automating the world one-liner at a time…

Adding elements to XML objects with Windows PowerShell

While it’s very easy to load and view the content of XML documents how do you add new elements? Here’s how: Let’s create a simple XML document, one parent node with two children: PS> [xml]$x = “<top> <first>first child</first> <second>second child</second>    </top>” PS> $x....

Windows PowerShell RC2 FAQs

Since the release of Windows PowerShell RC2, we've been receiving many questions around some of the changes from previous versions of PowerShell to RC2. To help clear up and confusion, I've taken the most common questions I've been hearing and have answered each below. Q: Which platforms are supported for PowerShell RC2?   PowerShell RC2 ...

Linking against RC2

The RC2 SDK is not yet available.  Until it is, here is a quick and dirty way for you to find/extract the DLLs to link your code against.  Do this from a RC2 shell and you'll a copy of the DLLS in C:\SDK:   PS>[appdomain]::currentdomain.getassemblies() | where {($_.fullname -match "system.management") -OR ($_.fullname –...

Windows PowerShell RC2 Now Available

Windows PowerShell RC2 Now Available Today Microsoft announced the availability of Microsoft Windows PowerShell RC2, the command line shell and scripting language that helps IT Professionals achieve greater productivity and control of system administration. Using a new admin-focused scripting language and consistent syntax and utilities...

Windows PowerShell ISV/Developer Conference – Oct 9-10th, 2006

Windows PowerShell ISV/Developer Conference – Oct 9-10th, 2006   We have a small number of available slots available for ISVs or Enterprise Developers to attend the Windows PowerShell & Microsoft Management Console (MMC) ISV Workshop (Building Next Generation Command Line and GUI Applications on Windows) on October 9th & 10th, ...

TECHED: IT Forum

We are putting together our plans for TECHED IT Forum being held in Barcelona from Nov 14-17.  I'll be there as well as a number of other people from the Windows PowerShell team.  We'll be showing some new and very exciting stuff so if you are an IT Professional in Europe - I hope I'll see you there! http://www.mseventseurope.com/...

Get-Process Piped to Dir

Did you know that you can pipe the output of Get-Process into dir?  Don't believe it?  Let me prove it: PS> Get-Process wi*Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName-------  ------    -----   &...

The Wonders of Date Math using Windows PowerShell

Larry Hayden posted a query about dates at:http://techtasks.com/bookmarks/powershell/2006/09/interview-with-a-scripter-jeffrey-snover/ He has a script which gets all the Application Events that happened TODAY: ————————————————————$today = [DateTime]::Today$Events = Get-Eventlog -New 1024 Application | ...

ErrorLevel equivalent

PSMDTAG:FAQ: ErrorLevel - what is the PowerShell equivalent? In Cmd.exe, %ErrorLevel% is a builtin variable which indicates the success or failure of the last executable run. In PowerShell, we support:     $?       Contains True if last operation succeeded and False otherwise.And   &...