Showing results for Advanced Functions - PowerShell Team

Mar 30, 2009
2
0

Image Manipulation in PowerShell

PowerShell Team
PowerShell Team

The other week, I showed a Get-ProgID function that I used to help someone at Microsoft Research find a good object to talk to images.  A few comments jumped to one of the possible solutions, which is to use the .NET Drawing assembly (which I have to load first).  I wanted to be reasonably sure that the way to get at the image metadata wa...

CTP3Advanced Functions
Mar 27, 2009
0
0

Get closure with GetNewClosure

PowerShell Team
PowerShell Team

Have you ever created scriptblocks on the fly, say in a foreach loop, and they totally mess up because they all have the same value? This is something sort of advanced, and typically used when you’re proxying an object. The most basic example would be, taken from (http://www.powershellcommunity.org/Forums/tabid/54/aff/1/aft/2506/afv/topic/Default.a...

CTP3Advanced FunctionsScriptBlock
Jan 10, 2009
0
0

Test-PSCmdlet

PowerShell Team
PowerShell Team

Everyone needs to get good with Advanced Functions – this is the easiest path to the best semantics for everyone.  In previous posts we’ve shown how you can add a few simple attributes and get a TON of stuff for free.  There is a LOT more to advanced functions.  You can go VERY VERY far with advanced functions.  I can’t think of...

CTP3PowerShell V2Jeffrey Snover
Jan 2, 2009
0
0

Get-Verb

PowerShell Team
PowerShell Team

.cmdletname { font-size:large } .cmdletsynopsis { font-size:medium } .cmdletdescription { font-size:medium } .cmdletparameters { font-size:medium } th { font-size: medium; font-style: italic } table { border: 1 } When I write a PowerShell function, I try to ensure that it follows the PowerSh...

Advanced FunctionsGet-Verb
Jan 2, 2009
0
0

A Module to Create Modules and Advanced Functions

PowerShell Team
PowerShell Team

[1/3/09 Update - the original link to the attachment containing this code was broken but is now fixed.  Sorry. jps] It is hard to overstate how important Modules and Advanced Functions are.   If you are a PowerShell user - you need to take the time to learn these new mechanisms and use them as your first choice in implement...

CTP3Jeffrey SnoverAdvanced Functions
Dec 24, 2008
0
0

PowerShell v2 Pipelining in 73 (make that 53) Characters

PowerShell Team
PowerShell Team

I started using Twitter and saw a request from Thomas Lee for help about pipelining in CTP3.  The thing about Twitter is that the messages have to be tiny so I wasn’t sure I could answer using it.  It turns out I can solve this problem AND give a usage example in 73 characters.  Here goes: PS> function t{param([Parameter(ValueFro...

CTP3Jeffrey SnoverAdvanced Functions
Dec 24, 2008
0
0

Resolve-ShortcutFile

PowerShell Team
PowerShell Team

If you're like me, you've got a browser favorites folder that is full of wonderful PowerShell code snippets. Ideally, it would be great to have a way to bring those favorite snippets into PowerShell so that my favorites folder becomes a code library. Doing this presents several challenges. The first (and easiest to solve) is getting the web page t...

CTP3Advanced FunctionsResolve-ShortcutFile
Dec 24, 2008
0
0

Get-MarkupTag

PowerShell Team
PowerShell Team

On my personal blog (Media And Microcode), I've been posting a series called "Scripting the Web", which introduced a function called Get-MarkupTag. Get-MarkupTag is a very handy little function that coerces individual tag elements of a web page into HTML, so you can scrape data from a webpage. I've updated Get-MarkupTag a tiny bit for CT...

CTP3Advanced FunctionsGet-MarkupTag
Dec 23, 2008
0
0

Advanced Functions and Test-LeapYear.ps1

PowerShell Team
PowerShell Team

Welcome to CTP3!  There are just an amazing amount of really important features in V2 but the one I want everyone to start using ASAP is Advanced Functions.  In CTP2 we called this cmdlets.  We dropped that term in favor of taking the idea of a FUNCTION and just making it more and more capable.  It is a bit of a misnomer in that...

CTP3Advanced FunctionsTest-Leapyear
Dec 23, 2008
0
0

More Advanced Functions – Get-Assembly and Get-ExportedType

PowerShell Team
PowerShell Team

Tyson Kopczynski has just published a great article Fun with PowerShell 2.0 Eventing!  That inspired to to write a script to automatically backup my modules directory.  I'm doing a lot of scripting this week and I don't want to lose my work if I make a mistake.  I thought I would write a scripting using PowerShell 2.0 Eventing to wat...

CTP3Advanced FunctionsGet-Assembly