PowerShell Team

Automating the world one-liner at a time…

KB: 1024 vs 1000

I love the fact that we designed PowerShell for Admins and IT Pros and love to demonstrate what that means.  Often I'll demo PowerShell and show how you can use "KB", "MB", and "GB" as I did in my previous blog entry: PS> 1kb1024PS> 1mb1048576PS> 1gb1073741824PS> 1kb+2mb+3gb3223323648 Almost uniformly, the crowds LOVE ...

File Aging Script

Jeffery Hicks as a very nice File Aging script.  The thing that Iike about it is that it provides a very good illustration of how to use a number of PowerShell features including: He had one technique that could be improved.  Here is a line from the script:  $GrandTotal="{0:N2}" -f ($GrandTotal/1048576) The question is, ...

[SWITCH]

Here is a pointer to a good demonstration of PowerShell's [SWITCH] datatype: http://msgoodies.blogspot.com/2006/12/negating-powershell-switch-parameters.html Jeffrey Snover [MSFT]Windows PowerShell/MMC ArchitectVisit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter...

$OutputEncoding to the rescue

You might have noticed that “findstr” does not work properly with non-English text in PowerShell. For example: Let’s create a text file with some Chinese characters in it. PS C:\> ${c:\test.txt}="中文" Try to use findstr to find  one of the Chinese characters, and it did not find anything. PS C:\> Get-Content test.txt | ...

Windows PowerShell SDK

Windows PowerShell Software Development Kit (SDK) is now available as part of Microsoft Windows SDK for Windows Vista. Microsoft Windows SDK can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyId=C2B1E300-F358-4523-B479-F53D234CDCCF&displaylang=en Windows PowerShell SDK contains: The documentation can also be...

Get-Weather

Jeffery Hicks has a very cool blog entry where he defines a Get-Weather script which downloads the weather from yahoo.com, casts the results to XML and then reports the weather using the Speech object.  It's totally cool.  I'm going to show it off today during my demo.  I'm down in LA meeting with MySpace and getting a tour of...

Resolve-Error

Recently I posted the following to the Microsoft.Public.Windows.PowerShell newsgroup (which you should participate in if you are not yet)  Below is a function that I encourage you to add to your Profile files and then use when reporting an error or ask a question about a exception you are seeing.  This function provides ...

PowerShell and IIS7 Revisited

A while ago I posted an entry about PowerShell and IIS7 which then directed you to a video of the demo I did with Bill Staples the PUM of IIS.  BTW - PUM stands for Product Unit Manager aka "BigWig", aka "Grand Pooba".  A PUM has like the CEO of a product of feature, they have Development, Test, and PM all report into them.  ...

Start-ScreenSaver

Boy do I love the community aspect of PowerShell.  The great thing about it is that you get the leverage really smart people from across the world.  I never spent any time thinking about screen savers and it turns out that you can just execute them like an exe. Here is a blog entry with a script Start-ScreenSaver which starts a ...

Get-PSUGUK – UK Users Group

Get-PSUGUK is the name of the PowerShell UserGroup being formed in the UK.  They are having their first meeting  on January 24th 2007 at Global Knowledge's office in Workingham starting at 18:00.  PowerGadgets is providing the beer and pizza.  The draft agenda is: Be sure to bring your laptops along and they'll  help...