Articles

PowerShell articles, tutorials, and guides from community experts.

Kirk Munro

This April is "Learn More About PowerShell" Month with the 2012 Scripting Games, the 2012 Microsoft Management Summit, and the 2012 North American PowerShell Deep Dive!

It"™s hard to believe that April is almost here already. Last week we had record high temperatures reaching 31°C (that"™s 87.8°F for those of you living south of the border), and the night before last it was -16°C (or 3.2°F). What wonderful consistency. Maybe that"™s why I like PowerShell so much, because it provides great consistency that just isn"™t apparent in so many other places in life (that"™s a swell tagline: “Use PowerShell, because it"™s more consistent than the weather” ).

Kirk Munro

Windows 8"¦reimagined?

The series of releases of client versions of Microsoft Windows seems to suffer all too much the same fate as Star Trek movies have in the past. This concept has already been discussed before, and there are even blog posts about it, such as Ewan Spence"™s comparison of Windows releases between versions 3.0 and Windows 7 to the Star Trek movies from “The Motion Picture” to “First Contact”. Windows 7 did indeed end up being a very impressive version of Windows, much like First Contact was a very impressive movie in the Star Trek franchise, and now we"™re watching with anticipation since Windows 8 Consumer Preview is now available and Microsoft is marching steadfast towards its release.

Keith Hill

PowerShell V3 Beta"“Better NTFS Alternate Data Stream Handling

One of the many new features in Windows PowerShell V3 is better support for alternate data streams (ADS) in NTFS files. ADS allows an NTFS file to contain additional data that is not part of the “main” stream i.e. the file"™s primary content. Tools like Windows Explorer or even PowerShell"™s Get-ChildItem cmdlet don"™t show these extra data streams. In fact the file size reported by both of these tools does not take into account the data stored in the alternate streams.

Kirk Munro

PowerSE 2.7 KB: PowerShell profile does not load on startup

Note: This blog post refers to an issue identified in PowerSE 2.7.0. It has been corrected in PowerSE 2.7.1, which is now available. With the release we published yesterday, both PowerSE and PowerWF received a new feature: product-specific profiles. This feature allows you to have profile scripts that you only want run in PowerSE or PowerWF run there so that you don"™t have to use if statements to check the host name in your profile scripts.

Kirk Munro

PowerWF and PowerSE 2.7 are now available

This morning PowerWF and PowerSE 2.7 were released to the web and they can now be downloaded from http://www.powerwf.com. These releases offer a lot of new value to PowerWF and PowerSE users, as follows: PowerWF 2.7 Highlights New Start Page with New Workflows The start page in PowerWF has been completely redesigned to provide immediate value out of the box for PowerWF customers. The new design highlights the Workflow Library that is included with PowerWF, allowing customers to play workflows in the library without opening a workflow or script document.

Kirk Munro

Essential PowerShell: To alias, or not to alias, that is the question

Recently there was a discussion between community experts and a product team about a module they are working on. The topic being discussed was cmdlet aliases: whether or not they should provide aliases for their cmdlets out of the box and if so, how they should be provided. Aliases are great for ad-hoc PowerShell work, which is what most PowerShell users do at this point, and incredibly useful when you"™re trying to put out a fire and managing your infrastructure using PowerShell.

Kirk Munro

PowerShell MVP for 2012

Every year around Christmas I anxiously await the New Year to see if I receive the Microsoft MVP award again that year. Well that email came on January 1, 2012, and I"™m quite thrilled about this one because it"™s a milestone this time (year 5 as a PowerShell MVP). Thanks to the community for being so great to work with, and thanks to Microsoft both for recognizing individual efforts with the MVP program and for creating such great products like Windows PowerShell!

Keith Hill

PowerShell V3 CTP2 Provides Better Argument Passing to EXEs

Within PowerShell it has always been easy to pass “simple” arguments to an EXE e.g.: C:\PS> ipconfig -all However passing arguments to certain exes can become surprising difficult when their command line parameter syntax is complex i.e. they require quotes and use special PowerShell characters such as @ $ ;. A lot of these problems can be solved by placing single or double quotes in the right places or by escaping PowerShell"™s special characters e.

Keith Hill

Microsoft Windows PowerShell V3 CTP2 Available for Download

You can grab the bits from here. If you have V3 CTP1 installed, please uninstall it first or you can get your machine into a bad state. So far my favorite two features new to this drop are both in the Integrated Scripting Editor (ISE). The first is the “most recently opened files list” on the File menu and second is the switch to a two pane ISE (combines the output and command panes into one).

Keith Hill

Windows PowerShell Version 3 Simplified Syntax

Windows PowerShell version 3 introduces a simplified syntax for the Where-Object and Foreach-Object cmdlets. The simplified syntax shown below, eliminates the curly braces as well as the need for the special variable $_. C:\PS> Get-Process | Where PM -gt 100MB ... C:\PS> Get-Process | Foreach Name ... The intent of this “syntax” is to make it easier for folks get started with PowerShell. Compared to the commands below, I can see the value of the simplified syntax: