One of the things that struck me whilst developing Grrr as a snapin is: what do you do when you have a cmdlet with the same verb-noun pair as an existing cmdlet?
If someone else had a cmdlet called, say, out-banner, and that cmdlet was already loaded in a snap-in (perhaps mandated by site policy), would I be able to register and add the Grrr snapin, which also defines it?
I’ve scanned the available documentation and the language grammar, used introspection in the shell and so on, but could not find anything to deal with this problem.
With projects like PowerShell Community Extensions seemingly laying claim to hundreds of common nouns and verbs, I was concerned that the scope for writing unique cmdlets would dry up real fast.
Read on »
Over the weekend, I set about writing an IRC chat client/channel monitoring tool in PowerShell (more on that in a day or so) and one of the things I was doing a lot was writing verbose and debug information to the console.
By default, Write-Verbose and Write-Debug cmdlets write nothing to the console, because the the value of the variables $VerbosePreference and $DebugPreference respectively are “SilentlyContinue”.
If you set them both to “Continue” the text is written to the console, but both in bright yellow on black (I wonder why?), like this:
PS> $DebugPreference="continue"
PS> $VerbosePreference="continue"
PS> write-debug "debug msg"
DEBUG: debug msg
PS> write-verbose "verbose msg"
VERBOSE: verbose msg
These colours can be changed so you can more easily distinguish between debug and verbose messages, and also not have the real output swamped.
Read on »