Before we proceed with putting powershell objects in a treeview (which I promised last time), I need to explain some changes I have made to the code. Refactoring the InvokeString functionality ouf of the menu item event Merging the error stream into the output stream Replacing the clear-host function with a custom cmdlet First, we [...]
Writing your own PowerShell Hosting App (part 5)
In the last post, we got to the point that we were actually using the new host objects that we implemented, but we still hadn’t provided anything more than trivial implementations (throwing an exception) for the methods that make a custom host useful, e.g. the write-* functions. Before we do that, we need to discuss [...]
An Overlooked Parameter
This isn’t so much a post as an extended pingback. This Post by Jeffrey Snover on the PowerShell Team Blog explains how to use the -expandproperty parameter of the select-object cmdlet. I had never noticed that parameter and was also annoyed by writing this all the time: get-something | foreach {$_.SomeProperty} It was an idiom [...]
Writing your own PowerShell Hosting App (Part 4)
WARNING: This is a long post with lots of code! In the last post, we got to the point that we ran into the limitatoin of simply running scripts through a bare runspace. You can accomplish quite a bit, but to have the full shell experience, you’ll want to actually create a the host objects, [...]