More Custom Attributes for PowerShell (Parameter Transformation)
I wrote a post awhile back about using custom attributes for PowerShell parameter validation but when I did it, I focused on the use of attributes to improve the error messages output by validation (specifically, by: ValidatePattern). There are many other things that can be done with custom attributes. However, PowerShell ships with two base [...]
How to: Invoke PowerShell and use the results from C#?
One of the questions that comes up a lot about PowerShell lately is how to use it from C#. For the sake of a simple example, I figured it’s past time I post the sort-of … Hello World of PowerShell hosting. I’m going to present this app plus a little bit more at the next [...]
Clip.exe and the missing Paste.exe
One of the guys on #PowerShell in IRC was asking about how to get the contents of the clipboard in PowerShell, and after we had tried several different scripts, we realized that in Version 1, because PowerShell runs in an MTA thread, you cannot access the clipboard without creating a new thread (in STA mode). [...]
NativeConsole.cs – Run console apps and get their output
To those of you who are not software developers: feel free to skip this post A while ago I wrote a little class for calling console apps from a .Net application, and I’ve been using it in several of my apps (most notably in PoshConsole) and it works great, but since the only place I’ve [...]
Visual C++ 2008 Feature Pack Released
Well, Microsoft has released its free Visual C++ 2008 Feature Pack for download — including a major update to MFC and an implementation of TR1 which includes smart pointers, regular expressions, containers and better random number generators. The update to MFC is a fairly major overhaul, and includes components which provide the L&F(Look And Feel) [...]