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… Read more

PowerShell v2 Pipelining in 73 (make that 53) Characters

I started using Twitter and saw a request from Thomas Lee for help about pipelining in CTP3.  The thing about Twitter is that the messages have to be tiny so I wasn’t sure I could answer using it.  It turns out I can solve this problem AND give a usage example in 73 characters.  Here… Read more

PowerShell V2 – External MAML Help

As you’ve probably picked up by now – Advanced Functions are super important. We’ve been showing a bunch of scripts that have embedded help using comments and dot-tags.  Let me take a second and drill into this. We believe that PS will be used in a wide range of; scenarios: simple one liners; personal ad… Read more

Write-CommandBlogPost

.CmdletName { font-size:large } .CmdletSynopsis { font-size:medium } .CmdletDescription { font-size:medium } .CmdletParameters { font-size:medium } th { font-size: medium; font-style: italic } table { border: 1 } On the PowerShell team, we’re big believers in the Virtuous Cycle. As you learn PowerShell more and more, things should get easier and easier to do. Inline… Read more

Configuring PowerShell for Remoting – Part 1

The features discussed in this blog post depend on PowerShell CTP3 release. Details about PowerShell CTP3 can be found at http://blogs.msdn.com/powershell/archive/2008/12/23/early-christmas-present-from-powershell-team-community-technology-preview-3-ctp3-of-windows-powershell-v2.aspx PowerShell v2 introduces a new capability to manage systems in your organization remotely.  We directly support hosting PowerShell in either WinRM service or IIS. In this blog I will talk about WinRM service hosting… Read more

Dreaming In PowerShell V2 : Lottery Numbers with Get-Random

Tobias Weltner writes a blog called Dreaming In PowerShell, and he recently posted a way to get a list of unique lottery numbers with PowerShell.  Dreaming In PowerShell is a cool blog, and the post is interesting, but it makes an assertion that’s no longer true in V2.  He uses System.Random to create the random… Read more

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… Read more

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 of how you would… Read more

More Advanced Functions – Get-Assembly and Get-ExportedType

Tyson Kopczynski has just published a great article Fun with PowerShell 2.0 Eventing!  That inspired to to write a script to automatically backup my modules directory.  I’m doing a lot of scripting this week and I don’t want to lose my work if I make a mistake.  I thought I would write a scripting using… Read more