PowerShell Team

Automating the world one-liner at a time…

How to Create an Object in PowerShell

Today someone in Xbox Live Operations (the folks that keep xBox Live alive and well) pinged me with a simple question about PowerShell with a complicated answer: “How do I create a class in PowerShell?” There’s two scenarios I find where people want classes.  The first (and most common) is familiarity: the person wants ...

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]  ...

How To Make Your Own Module Repository

Andy Schneider (from Get-PowerShell.com) recently asked me how he could make sure that everyone at Avanade could get a consistent set of modules.  I run into a somewhat similar problem here at Microsoft, where I want to take scripts I've built to work with internal applications and make them easy for people to use, even if they're not ...

Interactive remoting in CTP3

Today let's talk about one of the cool new features of Windows PowerShell V2 - Interactive Remoting. Let’s start with an example: As you can see Enter-PSSession starts interactive remoting session and Exit-PSSession takes you out of it. The aliases for these commands are etsn and exsn. You can also use exit keyword instead of Exit-...

Copy console screen to system clipboard

In the previous example we learned how to create a colorized copy of console in HTML and RTF format. However, the output of these scripts cannot be readily used for pasting into web or word processing applications. To insert it into your article in MS Word format, you need several steps: generate RTF string, save it to an RTF file, then open ...

Finding a URL For File Transfer Cmdlets

I just posted a blog about our new File Transfer Cmdlets in which I artfully dodged a difficult question:  How do you get the URL to do the file transfer?  Sometimes you are going to have it but other times you’ll go to a website and it can be bloody impossible to find the URL that you need to download.  That was the case with...

Transferring (Large) Files Using BITs

Have you had a file copy fail?  Does that drive you crazy or what?  How about when it is a REALLY big file and it takes a couple of hours and JUUUUUST before it finishes something happens to interrupt the transfer and you have to start all over again.  Does that make you want to shove a sharpened #2 pencil up your nose or what? ...

Test-PSCmdlet

Everyone needs to get good with Advanced Functions – this is the easiest path to the best semantics for everyone.  In previous posts we’ve shown how you can add a few simple attributes and get a TON of stuff for free.  There is a LOT more to advanced functions.  You can go VERY VERY far with advanced functions.  I can...