One of my favourite internal blogs has long been Terry Zink’s blog on spam analysis and fighting – from the perspective of somebody working on the Microsoft Exchange Hosted Services team. After some prodding by me (and probably others,) his blog is now public! And to make things even better, he’s Canadian :)
Something extremely helpful in learning a technology such as PowerShell is a pocket guide and quick reference. It doesn’t necessarily replace a structured tutorial as a learning resource, but fills an important role as a daily desktop reference. Over the last while, I’ve been working with O’Reilly to create such a guide – as the most ambitious addition to their “Short Cuts” program to date. The reference will be available in the very near future, so stay tuned!
Jim Truher just posted a script that he’s been polishing for the last few months – Background “jobs” and PowerShell. It’s awesome, and one of the first things that people ask for once they start settling in to PowerShell. What I love about being surrounded by a bunch of other PowerShell geeks is watching scripts like this come together. If I remember correctly, this script started off as a response to a question on our internal PowerShell distribution list.
Probably the most useful network tool on any operating system is Telnet. Not for connecting to Telnet servers, of course, as the Telnet protocol is about as insecure as they come. Instead, it’s useful for debugging connection problems with arbitrary ports and arbitrary protocols. Debugging an HTTP problem? You can Telnet into port 80 to help you resolve it. Debugging a mail retrieval issue? You can Telnet into port 110 to help you resolve it.
I’ve always loved Scott’s ultimate list of tools. To make things even better, PowerShell now plays a big part in this year’s list :) To add to the list, here are the first tools (not covered by Scott) I add to my systems: Start | Control Panel | Regional Settings | … | Dvorak Setting my system to the Dvorak keyboard layout is one of the first things I do on my non-work computers.
What do you do when your cats need to be fed automatically, and all you have is junk laying around the house? Inventing time!
[Edit 02/01/2012 - PowerShell added support for this in Version 2 via the following syntax:] PS > $r = New-Object "System.Collections.Generic.List[Int]" PS > $r.Add(10) PS > $r.Add("Hello") Cannot convert argument "item", with value: "Hello", for "Add" to type "System.Int32" (...) At line:1 char:1 + $r.Add("Hello") + ~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodException + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument (Original Post) Although the New-Object cmdlet is powerful, it doesn’t yet handle creating generic types very elegantly.
This has been coming up a bunch in the last little while, and I realized that I haven’t had a very good resource to point people to when they ask how to make a script or a function deal with pipeline input. Scripts, functions, and script blocks all have access to the $input variable, which provides an enumerator over the elements in the incoming pipeline. When pipelining is a core scenario, though, these constructs also support the cmdlet-style statement blocks of begin, process, and end.
After visiting 5 countries (Italy, Croatia, Greece, France, Spain,) 2 micro-states (Monaco, Vatican City,) and returning with a connection in Sweden, I’m back – and now 367% as worldly! The vacation was truly eye-opening. My only previous international experience (aside from growing up in Canada, and moving here to the United States) was a low-budget resort trip in the Dominican Republic. That trip gave me a filtered taste of a different culture, but had nowhere near the impact of a Mediterranean cruise around Europe.
In my last post, I gave an example of how to use P/Invoke through PowerShell to implement functionality not immediately available via the .Net framework. My example was to get the owner of a process, and Abhishek wisely pointed out that this is easier through WMI. So here’s another example. It’s actually the one I had written originally, but it didn’t give me an opportunity to illustrate [Ref] parameters, or [Out] parameters via P/Invoke.