OMI: revisited

Omaha

Initial plan was different, but it looks like next Tuesday (well, more like Wednesday in my time zone…) I’m going to present about OMI for the third time. This time I will present for Omaha PowerShell User Group. You can find meeting details (and sign up) here. I must say I’m super-excited. This group is relatively “fresh” (this will be their 2nd meeting). It’s lead by Jacob Benson and Boe Prox. And Boe is a person that I “know” for years. We never met in person, but he was one of few people I virtually known in my early PowerShell community days. That plus the fact that I learned a ton from his blog. No surprises, blog title says it all, right? Puszczam oczko

Continue reading

Advertisement

AST ‘splatting’ with static methods.

PowerShell-Splatting-With-StaticHave you ever wanted to use splatting outside it’s normal use with PowerShell commands? Splatting is great to pass (named) parameters to commands, but there are other elements that have named parameters. Perfect example: static methods that exist on .NET types. Unfortunately, in current version of PowerShell we can’t extend splatting concept to other language elements. But I guess a lot of people would agree with me: it would be great to be able to do something like:

$ToSplat = @{            
    format = "Using 'splatting' hashtable: {0:N2} and {1:N3}"            
    args = [math]::PI, [math]::E            
}            
            
[string]::Format(@ToSplat)

It may happen one day, but can we do anything about it now? Well… sure!

Continue reading

v3, AST and dot-sourcing.

How often do you find yourself in situation, when you would like to import functions from one of your scripts? Issue with that is related to the fact, that most of scripts I write have some purpose and they “do stuff”. When I want to import functions from the script I do not want to perform tasks that script would normally do – I just want function(s).

Continue reading