Interested in being a Technical Reviewer?

[Edit: Thanks for all of the interest – the review period is now closed.]

We’re getting close to “content complete” of Windows PowerShell: The Definitive Guide. The next step is technical review, where we look for both high-level and low-level feedback on the content and structure.

Also, this is a book focused on administrators. While PowerShell uber-hackers are always appreciated, inexperience with PowerShell is extremely valuable, as well.

If you’re interested in being a Technical Reviewer of the book, please let me know and I’ll forward your information to O’Reilly. Feel free to leave a comment here, or click on the mail icon in the sidebar to the right.

Discovering Registry Settings - PowerShell and Process Monitor

To give a glimpse into the writing process behind my upcoming “Windows PowerShell - The Definitive Guide” (O’Reilly,) I’ll occasionally post entries “as the author sees it.” This entry illustrates how to discover registry settings for programs that do not otherwise support scripted automation.

Discover Registry Settings for Programs

Problem

You want to automate the configuration of a program, but that program does not document its registry configuration settings.

Solution

Use Sysinternals’ Process Monitor to observe registry access by that program. Process Monitor is available from https://docs.microsoft.com/en-us/sysinternals/downloads/procmon.

Agony

You Can Write C / Assembly / Perl in any Language

One of the most common tasks when administering a system is working with its files and directories. This is true when you administer the computer at the command line, and is true when you write scripts to administer it automatically.

Fortunately, PowerShell makes scripting files and directories as easy as working at the command line — a point that many seasoned programmers and scripters often miss. A perfect example of this comes when you wrestle with limited disk space, and need to find the files taking up the most space.

Adding Double-Tap Tab Completion to PowerShell

One of the gestures that becomes very ingrained when working in a Unix shell is double-tap tab completion. When you press tab at a normal slow speed, the shell cycles through available tab completion possibilities. When you press tab quickly twice in a row, the shell displays all possible completions for your command all at once – and then lets you cycle through those possibilities.

That’s not a feature that PowerShell directly supports, but it is possible to get a good approximation to it by customizing your own TabExpansion function. The following script demonstrates a TabExpansion function that illustrates a framework for this. It is terrible as a stand-alone tab completion function (since it only tab completes on filenames – and poorly, at that,) but demonstrates one approach to getting double-tap tab completion in PowerShell.

Introducing: New PowerShell Language Enhancements

First of all, let me thank those of you that have adopted the Ad-Supported version of Get-ChildItem that we introduced last year. The additional revenue has proven quite effective for reducing world hunger, improving world peace, and providing spinner rims to those in need. In fact, several of you did indeed meet fun young DLLs in your area. As just one example of many, Jeffrey Snover recently announced his engagement to shell32.dll! Congratulations guys!

How do you get rid of the Judge?

Wow. I was looking through some old backups today, and found a writing assignment where we actually had to turn in the drek that came out when working to clear “The Judge.

The assignment was to do 8 of these 20-minute sessions in one week. By the end, I was closing my eyes and making an insane amount of typos.

Time 1:40pm, September 17.  Word count 1405
Time 1:26am, September 19.  Word count 1409
Time 11:46pm, September 19.  Word count 1694
Time 4:41pm, September 20.  Word count 1730
Time 6:59pm, September 21.  Word count 1793
Time 11:15pm, September 22.  Word count 1856
Time 11:08pm, September 23.  Word count 1942
Time 9:30apm, September 24.  Word count 1879
Time 11:35a, September 30.  Word count 1715

Advanced HTTP / ASP.Net Scripting with PowerShell

Back in the good ol’ days, my domain used to support a catch-all email address. I could give out any email address (as long as it ended in @leeholmes.com,) and still be guaranteed to receive the mail. When asked to create an account at some random website, I just make one up on the spot tailored specifically to them.

I got an odd look from my dentist when I did this, though. They must have thought — “who in their right mind likes dentists so much that they pick it for their email address?” As with all computer jokes, explaining it didn’t make it any better – I just got a smile and nod.

Converting C# to PowerShell

Tom recently ran into a problem with the Connect-WebService script given here – when run against a server that returns malformed headers, he received the error message, “The server committed a protocol violation.

The .NET Framework takes this approach as a security precaution, since parsing non-standard headers is one of the most common sources of vulnerabilities. It’s not that the header-parsing code has vulnerabilities (it may or may not, I have no inside knowledge,) but it is an absolute fact that you increase your risk as you expose more code to malicious input.

Getting Things Done – Outlook Task Automation with PowerShell

Scott just finished writing about his boss (and now him) using Blat to help him Get Things Done.

I’ve been “Getting Things Done” for some time, and one thing that’s always annoyed me was how difficult it is to convert a desire into a categorized task. Outlook 2007 had the opportunity to make this better with the quick-entry field in the TODO bar, but tasks entered that way unfortunately have a due date for “Tomorrow.” While not terrible, it means additional fiddling around – which I wanted to avoid in the first place.