PowerShell Team
Automating the world one-liner at a time…
Latest posts
Adam Weigert Puts NetApp On a String
Adam Weigert has started a new Codeplex project PowerShell OnTap. (That brings the total number of PowerShell-related CodePlex projects to 48!) OnTap provides a functions to manipulate NetApp servers using the OnTAP web service APIs. I’m not a NetApp user but I was interested in what he was doing and was delighted to read his code. It is an excellent example of PowerShell coding practices and has a number of excellent and clever techniques in it. I LOVE Adam’s code – it is logical, clean and visually coherent. You should view it in an editor that does syntax coloring (lik...
A Thousand Things 1% Better
One of my all time favorite books is The IBM Way by Buck Rodgers. (Actually make that "all time BUSINESS books", it's not in the same league as Discourse on Method or Thus Spake Zarathustra.) One of my favorite statements Buck made was something to the effect of, "products of true enduring quality are not those that do 1 thing 1000% better but rather those products that do 1000 things 1 % better". In other words, details matter. We tried to cover as many details as we could with V1 but frankly we covered so much ground that some things were not a crisp and clean as we...
RDP File Generation/Use of HERE-Strings
Over on the Everyday Nerd blog, I found a great blog entry you should read: Create multiple RDP files with PowerShell. He describes his environment where he has to manage a large set of servers using Remote Desktop (RDP). Having to configure the RDP settings each time he connects to the server, he decided to automate the process by writing a script which generates the RDP files for him. The script itself is cool but the think I wanted to highlight was that the script is a great illustration of a very powerful scripting design pattern. It uses: This pattern has a numb...
Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)
Do you hate Add-Member as much as I do? Wait - maybe you aren't familiar with Add-Member or the glory of PowerShell's Adaptive Type System. (ATS). When I looked at the .NET type system, my reaction was "....almost". I'm not trying to throw a rock at .NET - anyone that knows me knows how much I love .NET but the reality is that it's type system "almost" meets the needs of a management system ... but doesn't. That is why we invented the Adaptive Type System. There are 4 main components of ATS: Type Adapters. A lot of technologies implement their own type systems within .NET.&nb...
OMG – Check This Out (Data Visualization with PowerShell)
Doug Finke has been having fun working with PowerShell and .NetMap from MSR. Now he has written this AMAZINGLY tiny script to call the World Bank's WebService and visualize the world by income level. This has to be seen to be believed. If you were ever unclear on the power of the compositional model (toolkit approach) or the productivity you can achieve with PowerShell - just go visit this blog. Check it out HERE. Doug - awesome stuff. Truely wonderful. You've made my day. Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog a...
Join Me Tonight on the PowerScripting Podcast
Tonight at 9pm EST (6pm PST) (UTC-4), I'll be one of Hal Rottenberg's guiests on his live Podcast., You can find the live show details at the top right corner of http://powerscripting.net. Apparently you'll be able to ask questions but not throw beer bottles (the internet is awesome!). I have no idea what we'll talk about so who knows what will come out. Let's just hope I don't say anything that get's me fired. ha ha. It should be fun - join us. Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blog...
Text Output Is Not a Contract
In PS V1, this is what you get for GET-COMMAND -SYNTAX PS> Get-Command Get-Process -SyntaxGet-Process [[-Name] <String[]>] [-ComputerName <String[]>] [-Module] [-FileVersionInfo] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>]Get-Process -Id <Int32[]> [-ComputerName <String[]>] [-Module] [-FileVersionInfo] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-Erro...
Speeding Up PowerShell Startup – Updating Update-Gac.ps1
Have I ever mentioned how much I love the community? Today Kirill Osenkov posted a comment on the blog pointing out that there was an API to get the .NET Framework install path: RuntimeEnvironment.GetRuntimeDirectory() . I didn' t know that and now I do. :-) I took the opportunity to rewrite Update-Gac.ps1 and in the process I decided to make it better. This illustrates the point I've made many times. With GUIs - you click buttons and that the end you what do you have? Maybe the system works, maybe it doesn't and that is it. With scripting, you end up with a system ...
Get-Constructor Fun
Here is a quick and dirty function I wrote after getting PO'd at having to look up documentation for constructors: NOTE: Jim Truher thinks long typenames are useful so I added a switch (-FullName) so you could get them if you want them. function get-Constructor ([type]$type, [Switch]$FullName){ foreach ($c in $type.GetConstructors()) { $type.Name + "(" foreach ($p in $c.GetParameters()) { &...