Auto-Updating With No Reboot

Despite being a fan of security, I’ve always run Windows Update in “Download and Notify” mode for all of my machines. Having Windows Update reboot my machine without warning at 3:00 AM is just too destructive. This has two negative effects: - Security patches that don’t require a reboot are needlessly postponed. - Programs that auto-update frequently via Microsoft Update turn into a permanent task-bar nag that you have updates to install.

Why So Secure?

After working with PowerShell for awhile, then starting to write scripts, you quickly learn about PowerShell’s Execution Policy and other security features. You might even throw up your hands, and ask, “Why is this configuration so HARD? Why can’t it be as easy as VBS and Perl?” You can double-click on a VBS or CMD script and have it run automatically. Those scripts could invoke PowerShell anyways, so why put all this effort into security?

Get-Help -Online

In CTP2 of PowerShell v2, we added a new parameter to Get-Help: Online. This parameter lets help authors declare an “online version” of their help topic, which PowerShell then launches with your default browser. For the PowerShell cmdlet help topics, we redirect to the excellent (and more frequently updated) online cmdlet help topics: http://technet.microsoft.com/en-us/library/dd347701.aspx. PowerShell supports online help content for both MAML-based help topics (http://msdn.microsoft.com/en-us/library/bb525433(VS.85).aspx, http://blogs.msdn.com/powershell/archive/2006/09/14/Draft-Creating-Cmdlet-Help.aspx, http://blogs.msdn.com/powershell/archive/2008/12/24/powershell-v2-external-maml-help.aspx) and inline help comments (http://technet.

Things more likely to kill you than Swine Flu

There are a few. Based on worldwide numbers (160 confirmed deaths, 3000 “suspected” cases) Falling out of bed (900 confirmed deaths) Falling down the stairs (1,690 confirmed deaths) Big storm (874 confirmed deaths) Drinking binge (346 confirmed deaths) Of course, the statistic left out by the news Normal flu (36,000 confirmed deaths per year) http://www.nsc.org/research/odds.aspx

PowerShell Audio Sequencer

I got forwarded an addictive interactive sequencer yesterday (http://lab.andre-michelle.com/tonematrix) and was immediately hooked. I asked an internal mailing list if there was any kind of hardware that lets you do this kind of thing on the couch, and got the response – “you mean MIDI?” That’s close, but it is closer to a very simplified sequencer. I play classical guitar… even being a fan of electronic music, I had never seen a sequencer used, or tried to make anything in one.

More Tied Variables in PowerShell

Ibrahim just posted something to the PowerShell blog about how to create tied variables in PowerShell. If you extend this approach with script blocks, you have a very powerful dynamic scripting technique. PS C:\temp> cd \temp PS C:\temp> New-ScriptVariable.ps1 GLOBAL:lee { $myTestVariable } { $GLOBAL:myTestVariable = 2 * $args[0] } PS C:\temp> $lee PS C:\temp> $lee = 10 PS C:\temp> $lee 20 PS C:\temp> New-ScriptVariable.ps1 GLOBAL:today { (Get-Date).DayOfWeek } PS C:\temp> $today Wednesday PS C:\temp> New-ScriptVariable.

Want to Influence the PowerShell Cookbook V2?

We’ve started working on the next edition of the PowerShell Cookbook, and one obvious goal is to improve on the first version. As the first version has been in print, I’ve taken notes on where people get confused with certain recipes. I’ve taken notes on what I felt were content gaps, and taken the feedback from reviews on Amazon.com and random blogs. Reviews on Amazon are GOLD for authors. They help readers form educated opinions, and provide helpful feedback about the book itself.

Moving and Deleting Really Locked Files in PowerShell

Once in awhile, you need to do brain surgery on files locked by the system. This is a common problem run into by patches and hotfixes, so Windows has a special mechanism that lets it move files before any process has the chance to get its grubby little hands on it. This can only be done during a reboot, leading to the dire warning given to you by many installers.

Making Perfect Change with the Fewest Coins

I’ve long wondered exactly how few coins you need in your pocket in order to perfectly round out any bill. I usually grab a handful and hope it works out. Even that mathematically astute technique sometimes leaves me a nickel or few pennies short, though, so I settle for making change that gets me a quarter back instead of yet another handful of ore. Even this settle-for-second-best option isn’t that great.

More PowerShell Syntax Highlighting

Vladimir Averkin recently wrote a series of posts that show how to export code with syntax highlighting into HTML and RTF formats. It works great in Outlook, but was causing Windows Live Writer to crash. The reason is that the HTML stream of the clipboard isn’t just a blob of HTML – it’s supposed to be placed into the clipboard as CF_HTML. Investigation of that issue gave enough information to exactly pinpoint the crash in Live Writer, which they were quick to resolve once we pointed out.