Monthly Archives: April 2014

More potential use cases for thread-safe variable access in PowerShell: Events (Except, not really…)

13-May-2014 Update: Turns out, this whole post was wrong. 🙂 While event handlers in PowerShell appear to be asynchronous from your script / console’s point of view (meaning that they can execute in between PowerShell statements that you’re running), the … Continue reading

Posted in PowerShell | Tagged , , | Leave a comment

More on PowerShell multithreading via runspace pools

It turned out to be easier to write the Lock-Object function than it was to test it. There has been some great work done on figuring out the use of Runspaces for multithreading by the PowerShell community over the past … Continue reading

Posted in PowerShell | Tagged , , , | 3 Comments

Using-Object: PowerShell version of C#’s “using” statement.

I don’t know why I did this. Performance is better if you use try/finally directly, rather than passing script blocks around. But, if you want PowerShell “using” syntax that looks similar to the C# examples you see on MSDN / … Continue reading

Posted in PowerShell | 7 Comments

Cmdlets or Advanced Functions?

I’ve written quite a few Advanced Functions for the PowerShell community over the past year. It’s awesome to be able to produce the behavior of a Cmdlet using syntax that the people using your module will be familar with. If … Continue reading

Posted in PowerShell | Tagged , , , , , | 14 Comments

Thread Synchronization (in PowerShell?)

Up until now, I had been under the impression that there’s no need to worry about synchronized access to objects in PowerShell, even when using runspaces. (See Jason Shirk’s comment on this stackoverflow post.) Reading today’s Hey, Scripting Guy! blog … Continue reading

Posted in PowerShell | 1 Comment

MVP!

(No, it’s not an April Fool’s joke. 😉 ) This morning I learned that I’ve received Microsoft’s MVP award for Windows PowerShell! Looking forward to getting a peek behind the curtain, as it were, once my access has been updated. … Continue reading

Posted in Personal, PowerShell, Professional | Tagged , | Leave a comment