PowerShell Team

Automating the world one-liner at a time…

Flexible pipelining with ScriptBlock Parameters

PSMDTAG:FAQ: How can I pipeline data to a parameter which does not accept pipeline input?PSMDTAG:FAQ: What are ScriptBlock Parameters? One of the foundation concepts of Windows PowerShell is pipelining objects instead of text.  What happens is that when an upstream command generates an object, the PowerShell engine examines the data ...

$ERRORVIEW="CATEGORYVIEW"

<Edited 7/2/2006 with tags and categories>PSMDTAG:FAQ: What is $ErrorView?PSMDTAG:FAQ: How do I get error details? Have you tried out $ErrorView="CategoryView" yet?  Remember -  errors are just objects.  Given that they are objects, we render a subset of their properties to the console.  We provide 2 views: ...

Using Format Control Strings.

PSMDTAG:FAQ: How do I display large numbers with commas?PSMDTAG:FAQ: How do I use .NET formatting strings? As scripters, we often spend tons of times trying to get our data formated just the right way.  Often this is an error-prone, frustrating experience.  Windows PowerShell leverages .NET objects to make this task a ton simpler.&...

Filing Bugs

With the release of RC1 of PowerShell, we've closed down on doing much feature work and are primarily polishing the product. This means fixing bugs, cleaning up usability issues, and really making sure this is a quality product. For those of you unfamiliar with Microsoft's milestone naming terminology, RC1 stands for Release Candidate 1. This ...

em dash, en dash, dash, dash, dash…

Some people have noticed that you can paste examples out of Word documents directly into a PowerShell session. Given all of the typographic tricks that Word does, this is actually much harder than it sounds. Here’s what we do. There's a piece of code in the interpreter that takes each of the possible characters and maps it into the ...

The new TabExpansion feature…

One of the nicest new features in the latest drop of Windows PowerShell is enhanced tab-completion. We now tab-complete properties on variables and parameters on cmdlets in addition to the old filename completion. But that's not the interesting part. The cool bit is that it's done through a user-definable function. In the same way that you can...

How to Access or Modify StartUp Items in the Window Registry

Some applications launch themselves whenever you start your computer and load Windows.  In most cases, this is the desired behavior.  However in some instances, malicious programs such as spyware, Trojans, worms, viruses load in this manner and hijack your computer. It is important to stay vigilant and periodically monitor your ...