Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Scripting Tricks   (RSS)

Microcode: PowerShell Scripting Trick: Fun With Parameter Binding: The Fake Parameter Set Trick

I’ve been hearing a lot of questions recently about what things you can do with advanced functions.  People seem to be aching for good examples of using PowerShell V2 functions, and, since I’ve discovered a few handy tricks for advanced functions,

Microcode: PowerShell Scripting Tricks: Scripting the Web (Part 3) (Resolve-Link, Get-WebPageLink)

The first post in this series was learning to crawl. I introduced Get-Web , which allows you to use System.Net.Webclient to download web sites in a variety of ways. The next post was learning to walk. I showed us Get-MarkupTag , which helps coerce parts

Microcode: PowerShell Scripting Tricks: Select-Object (Note Properties) vs Add-Member (Script Properties)

As I've said a number of times before, PowerShell's quantum leap forward is something called the Object Pipeline.  It allows you to take the results of one command and easily use them with the next, which means that each command you create becomes

Microcode: PowerShell Scripting Tricks - Exploring .NET Types with a Get-Type function and Reflection

There's a simple yet powerful function that nearly everyone on the PowerShell team has written a version of.  My version is called Get-Type.  It's only a one-liner, but it's an amazing way to explore .NET and it's also an amazing example of

Microcode: Scripting Tricks : Exploring WPF Routed Events with PowerShell

Both WPF and PowerShell are both full of great little touches. One of WPF's nice touches is Routed Events . Routed Events allow you to capture events raised by child controls or parent controls. This can be incredibly useful, because it allows you write

Microcode: All About Modules (Windows PowerShell CTP2)

In a previous post , I showed you how you can debug Windows PowerShell cmdlets and providers in Visual Studio and load them up without using installutil.exe. This very briefly touched on using the command Add-Module, in this case, to load up an assembly

Microcode: PowerShell Scripting Trick - Writing functions that use the pipeline or take arguments

I was cleaning up some scripts for posting when I happened upon this minor trick. I had a function that was using $input, a PowerShell v1 feature that allows you to use pipelined values within a function.  This enables you to do basic pipelining
 
Page view tracker