Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » HowTo   (RSS)

Advanced Debugging in PowerShell

Here is a collection of tips and tricks to debug PowerShell Read Up There is a 7-part series of “ Debugging Monad Scripts ” that Jon Newman wrote a few years ago that covers a lot of tips, including error handling, traps, tracing, and covers a lot of

Adding Custom Cmdlet Help for Providers

A new feature of Windows PowerShell 2.0 lets you write custom cmdlet help for Windows PowerShell providers. This blog explains how to do it. (The topic will also be covered in excruciating detail in MSDN, but we don't want you to wait.) What's a Provider?

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
Posted by PowerShellTeam | 7 Comments
Filed under: ,

How To Write a Console Application in PowerShell with Add-Type

Windows PowerShell CTP3 has a lot of very cool things.  CTP2 introduced the Add-Type cmdlet, which allowed you to dynamically compile C# in PowerShell.  It was actually possible to use the CompilerParameters to Add-Type to make a console application,
Posted by PowerShellTeam | 21 Comments
Filed under: , ,

What the Heck is an ENUM?

In my latest post Explore your [Environment] I said the following: PS> [System.Environment+SpecialFolder] IsPublic IsSerial Name                                    

Explore Your [Environment]

This topic is a little long but I strongly encourage you to walk through it and master the techniques it illustrates.  I can assure you that you'll will use them a couple thousand times in the next couple of years. .Net provides a wonderful class

When NOT To Use "WHERE"

I've seen a number of scripts that look like this: GET-XXXX | Where {$_.name -eq "foo"} or GET-XXXX | Where {$_.name -like "A*"} Whenever you see code like this, it is a sign that the GET-XXXX is not designed correctly. (NOTE: GET-XXXX is NOT a porn retrieval
Posted by PowerShellTeam | 5 Comments
Filed under:

All About Modules

One of the coolest new features of Windows PowerShell is PowerShell modules.  I've just written a tutorial about how to use them on my personal blog . You can check out the full post for more details, but here are some easy things to remember about
 
Page view tracker