Rage Against the Design
So we found a problem recently with a certain scripting language’s argument parsing: function Test-Argument($a) { $a.GetType().FullName } [Test 1]: Test-Argument 4 System.Int32 [Test 2]: Test-Argument .5 System.Double [Test 3]: Test-Argument "hello" System.String [Test 4]: Test-Argument Goodbye System.String [Test 5]: Test-Argument -42 System.String [Test 6]: Test-Argument (-42) System.Int32 Why can’t it properly parse [...]
PowerShell 2 CTP3 – First Impressions
Changes of particular interest Get-Command returns functions By default Get-Command used to return only apps, scripts in your path, and cmdlets… The new CTP3 default invocation includes functions. This is mostly a recognition of the increased power of functions with the arrival of that advanced function features (formerly known as script cmdlets). Advanced Functions Advanced [...]
PowerShell and Hashtable oddities
Hashtables are IEnumerable, but they don’t behave that way in PowerShell … this seems to cause all sorts of odd behavior …
A Better Get-Credential in one line of code
For too long I have ignored the deficiencies in Get-Credential, so now I am going to fix them. Ready? function Get-Credential($caption,$msg,$domain,$name){$Host.UI.PromptForCredential($caption,$msg,$name,$domain)} Ok, that’s better than the default, whew! At least you can specify the prompt text and the domain and default user name … but there are so many other options that are missing from [...]
Is PowerShell $ShellId too big a burden?
As you may know, I was one of the first developers who jumped on board and started working on an alternative PowerShell host (actually, I’m also the first to create a WPF-based host, and the first to create one that was open source … but enough about me). Recently I’ve picked back up on that [...]
What’s the desired behavior of inputObject?
In response to Kirk Munro’s comment on my Writing Cmdlets for the PowerShell Pipeline post: You know, I’ve looked at your articles about cmdlets/functions in the pipeline and I feel you’re missing something. The purpose of the InputObject parameter is to pass in a collection as a single object. This is as opposed to using [...]