Customize Even More with AutoHotkey

One of the things people commonly ask about is support for rich keyboard macros and hotkeys in PowerShell. For many, a pointer to the Doskey hotkey reference (which provides the history management functionality in PowerShell’s “cooked mode”) is enough: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/doskey.mspx?mfr=true. Once you’ve become used to those features, though, you start to want more – especially if you’ve grown accustomed to some of the power available on traditional Unix shells. Typical questions include:

PowerShell Credentials and GetNetworkCredential()

Martin Zugec recently wrote about a security concern he has with PowerShell: Once you have a credential (i.e.: from Get-Credential,) it is quite easy to get the plain-text password by calling its GetNetworkCredential() method. The reason we don’t make this more difficult is that you already have the credential. In security, something is either possible or impossible – “hard” is just another way of saying “possible.” We designed the GetNetworkCredential() method to give you the System.

Getting Better Gas Mileage

Ask any driver where they get their gas, and you’ve opened a deep discussion. There are the few that get it from wherever (including the canteen in the back of their trunk because they always run out,) but most drivers have a preference. The first question is, “Where do you get your gas?” Do you go for the cheapest gas station you can find, or go to the expensive places because it must be better?

Redirecting Binary Output in PowerShell

An interesting problem recently came up in the PowerShell newsgroup, where somebody was trying to use a tool (jpegtopnm.exe) that let you pipe its binary output into a file. This works on Unix (and from cmd.exe,) but unfortunately generated a corrupt image when done in PowerShell. When PowerShell launches a native application, one of the benefits we provide is allowing you to use PowerShell commands to work with the output. For example:

Import Quicken’s QIF files into PowerShell

Recently, Jeffrey wrote a post, “Blog your initial PowerShell experiences.” I thought, “Even better, blog your automation!” So much of what makes people fall in love with PowerShell comes from the little problems it helps you solve. The more of those techniques we can help people learn, the better. That post turned into “Break your Writer’s Block” – which is good, because there is already a good discussion going about blogging your automation here and here.

PowerShell books becoming available

Some more PowerShell books are becoming available – this is a very exciting time! First, there’s Don Jones & Jeffrey Hicks' PowerShell: TFM Second, there’s Jerry Lee Ford Jr.’s Microsoft Windows Powershell Programming for the Absolute Beginner Congrats on a huge milestone, and thank you for your contribution!

Determining your 401(k) Contributions

On January 1, 2006, many companies began to offer the Roth 401(k): an alternative to the traditional 401(k) that allows you to contribute your money in after-tax dollars, rather than pre-tax dollars. Most (in my opinion incorrectly) summarize the difference as the following choice: “If you think you might be in a higher income tax bracket when you withdraw the funds, invest in the Roth 401(k). Otherwise, invest in a traditional 401(k).

Break your Writer’s Block

In writing, overly-ambitious goals often mean not writing at all. It sounds odd, but it’s true. Take most tumbleweed-ridden, ghost-town technical blogs. From my experience, the vast majority of them have authors that are working on this educational, pedagogical masterpiece – but their Magnum Opus sits in a half-finished Word document on their hard drive somewhere. All of the sudden, the joy of writing begins to leech away: they want to blog something, but this 2,000 word monster draft mocks them from the shadows.

Filtering on the Certificate Provider

Well, after a long holiday break, the first thing on both of our minds, naturally, is filtering on the Certificate Provider. A suggestion came up recently in an internal discussion list to add more dynamic parameters to Get-ChildItem when you’re in the certificate provider. For example, the –CodeSign parameter is extremely useful: [cert:\] PS:2 > dir -rec -codesign Directory: Microsoft.PowerShell.Security\Certificate::CurrentUser\My Thumbprint Subject ---------- ------- 5D103CCDCFE0D96748A305DFACA9C942ABFD73E7 CN=PowerShell User [cert:\] PS:3 > $cert = dir -Recurse -CodeSign [cert:\] PS:4 > Set-AuthenticodeSignature c:\temp\MyScript.

Outlook Automation in PowerShell - Calendar Scrubbing

Here’s one thing you might have noticed happening to your Outlook calendar. As time goes on, the calendar titles get obscured by the ugly meeting barnacles such as “FW: " and “Updated: “. I don’t know anybody that cares about that meta-data, but it lives on – and I’d like to remove it. Omar Shahine mentioned that he wrote an Outlook addin to do this once. Since I’ve been doing some mail management tasks with PowerShell lately (more on that in future posts,) I thought it might be a useful thing to demonstrate via Outlook’s Outlook.