How to get the Char(acter) and VirtualKey from a WPF KeyDown event
While working on my WPF PowerShell console, I’m working on implementing PSRawUserInterface, and had to implement a method called ReadKey which returns a KeyInfo object. KeyInfo is a pretty simple struct class with four properties: VirtualKeyCode Character ControlKeyState KeyDown So it doesn’t seem like it would be a real problem … just handle the KeyDown [...]
Be a responsible geek – encrypt your email (free)
Everyone should encrypt their emails … especially geeks, who can be expected to understand how little effort it would take for a rogue sysadmin or clever hacker to sniff your email on it’s way to it’s intended destination. Incidentally, if you’re a geek and you don’t know that, you should try running WireShark while you [...]
PowerShell dig (nslookup) Cmdlet!
So, today someone came to #PowerShell on irc.freenode.net and asked how to do nslookup functionality natively in PowerShell, and nobody knew how … and then as the question evolved, it turned out that what they needed was to do a lookup for both MX and TXT records for a series of domains … To cut [...]
Random News Digest …
There’s fun stuff happening lately, so here’s a post full of tidbits you may have missed. Like: Codeplex has announced Subversion support. They will be running a server-side SvnBridge to allow access to all the projects so you can grab source more easily because it supports anonymous access. Amusingly, it’s actually easier to use than [...]
PowerShell PowerUser Tips: List the Cmdlets in an Assembly
Tiny script… let me know if you know a better way. function Get-Cmdlets { param([System.Reflection.Assembly]$assembly) $assembly.GetTypes() | Where-Object { $_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false) } | ForEach-Object { $type = $_ $_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false) } | Select VerbName, NounName, @{n="Type";e={$type}} | } ## Example usage. ## You can use the [System.Reflection.Assembly]::Load… methods to get [...]
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 [...]
PoshCode OpenSearch
Well, an interesting comment came up today that the new version of PoshCode.org that we’re working on should support OpenSearch and of course, me being me, I said: oh, OpenSearch is easy, gimme a minute… And three hours later, I’m going to bed. However, I did manage to add paging support so you can “browse” [...]
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 [...]