PowerShell Team

Automating the world one-liner at a time…

Resolve-ShortcutFile

If you're like me, you've got a browser favorites folder that is full of wonderful PowerShell code snippets. Ideally, it would be great to have a way to bring those favorite snippets into PowerShell so that my favorites folder becomes a code library. Doing this presents several challenges. The first (and easiest to solve) is getting the web ...

Get-MarkupTag

On my personal blog (Media And Microcode), I've been posting a series called "Scripting the Web", which introduced a function called Get-MarkupTag. Get-MarkupTag is a very handy little function that coerces individual tag elements of a web page into HTML, so you can scrape data from a webpage. I've updated Get-MarkupTag a tiny bit ...

Advanced Functions and Test-LeapYear.ps1

Welcome to CTP3!  There are just an amazing amount of really important features in V2 but the one I want everyone to start using ASAP is Advanced Functions.  In CTP2 we called this cmdlets.  We dropped that term in favor of taking the idea of a FUNCTION and just making it more and more capable.  It is a bit of a misnomer in...

PowerShell V2: ParameterSets

One of the great benefits of PowerShell V2 Advanced Functions is the ease in which you can support parametersets.  ParameterSets are, well, different SETS of valid parameters.  For instance you can say: Get-Process -id 0 Get-Process -Name *ss Those are 2 different parametersets for the Get-Process cmdlet.  Here is an example ...

Windows PowerShell CTP2 to CTP3 Conversion Guide

I write a lot of scripts, and, since I blog some of what I write, my home computer has been running Windows PowerShell CTP2 since it came out.  Since CTP3 has a number of changes from CTP2, I've got to update my home script library to work with CTP3.  While this guide might not have every change that happened in between CTP2 and CTP3...

Emit-XML

I was writing a demo yesterday and needed a quick and dirty way to generate some XML so I wrote the function below.  This highlights a couple of changes that are coming up in CTP3 that I thought I would preview. 1) The keyword "cmdlet" is going away and we'll just have "function".  Notice that now you ...