PowerShell Team
Automating the world one-liner at a time…
Latest posts
Strict Mode: V1 Debug Tool V1 / V2 Best Practice
When we designed PowerShell we decided that we wanted to have Shell syntax and semantics because this is what was missing from the market and because it supports the ad hoc development practice that is so suited to the needs of administrators. We also observed that most shells ran out of power pretty quickly and people had to throw away their scripts and start from scratch with a more powerfull scripting language like Perl. Sadly, sometimes those environments ran out of power as well and people had to throw them away and start from scratch using a systems programming language like C++. ...
The Future Is Here Today
Would like to see what a PowerShell V2 world would look like? If so, check out Jaykul Bennett's Select-Grid script HERE. Here is what impresses me so much about this: Imagine hundreds, thousands, tens of thousands of other 200 line scripts with similar power. Imagine people taking this base script and adding 10 more lines to to things just they way they need them to be. The might not have been able to write the script from scratch but it is not that hard to add 10 lines to an existing script.Now imagine that have a graphics friend and you ask them to replace the WPF with something b...
PowerShell on WS08 Server Core!!!!
Superstar Dmitry Sotnikov has done the world a great service today by documenting how to get PowerShell running on WS08 Server Core HERE. Just to be clear, this is not a MSFT supported configuration. That does NOT mean that we think it won't work. What it means is that if it doesn't, you have to leverage the community to help you figure it out instead of Microsoft support. [Insert your favorite snarky remark here] :-) As admins, it is just a simple fact of life that we have to color outside the lines to get our jobs done. Yes - it would be best if we could ...
TIOBE: PowerShell on its way to the top 20 (Programming Languages)
The TIOBE Programming Community Index provides a monthy rating of the popularity of programming languages. This month's headline was: PowerShell on its way to the top 20 I'm not sure how they rate popularity or how they came up with that title (given that right now we are at 36) but I liked the headline! Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
Doug Finke's Amazing 7 Minute C# => PowerShell Demo
Doug Finke has just posted a blog entry HERE with an awesome 7 minute video demo HERE. I HIGHLY recommend this as a great use of 7 minutes of your life (or as Doug points out, you can type Ctrl-Shift-G to speed it up and it will be a great use of 4-5 minutes of your life :-) ) In the demo, he starts out writing and running some C# code. He then takes advantage of the new PowerShell V2 feature Add-Type to run this code from a PowerShell script. Then, step by step, he transform the original C# code into PowerShell and ends up with a single line of PowerShell. Each step produces a running PowerShel...
In Praise of TypeConverters – Spread the Love
I just got through reading Scott Hanselman's blog entry: TypeConverters: There's not enough TypeDescripter.GetConverter in which he referenced Jesse Liberty's blog entry: Did You Know That... Type Converters allow you to use property attributes in Complex Types and decided to pile on. Developers - you should stop what you are doing and get TypeConverters in focus. Here is the big picture way to think about it: As developers, our mission in life is to make the lives of others easier by providing them the functions they need in they way they need them. TypeConverters play a huge role ...
Remoting with PowerShell QuickStart
PowerShell V2 introduces a new capability which allows you to remotely manage machines in your organization. I will give a basic overview of PowerShell remoting here and follow it up with some adavanced topics later. Are you ready for the fun.. A remote interaction involves 2 endpoints – Client and a Server. The same computer or system can act both as a client and as a server. Configuration To enable an endpoint for PowerShell remoting you need to do the following: Step 1: Install PowerShell CTP2 of PowerShell V2 Step2: Install CTP of WinRM Step 3: Configure WinRM for PowerShell remoting. This can be done from...
Fun with Script Cmdlets
Script Cmdlets are one of the coolest things about the newer version of PowerShell. A Script cmdlet allows you to use all of the variety of cmdlet parameter sets inside of PowerShell functions. Since Script Cmdlets are PowerShell functions, and the PowerShell engine prefers to run functions rather than commands, you can use Script Cmdlets to override an existing cmdlet. You might want to do this to add or remove parameters from a cmdlet you use often. Also, you might just want to see what a cmdlet’s parameters look like in a script cmdlet, so you can go write your own. Luckily, Powershel...
PowerShell Transactions QuickStart
The second CTP of PowerShell V2 (CTP2) introduces full engine support for transactions – groups of actions that can be finalized or undone in an all-or-nothing way. Wikipedia gives a great overview of transactions here: http://en.wikipedia.org/wiki/Database_transactions. We put a ton of thought into how to expose this normally developer-centric concept in a way suitable for system administration and system administrators. We would LOVE to hear your feedback on what concepts or behaviours make sense, and especially which ones do not. We didn’t get a chance to fully document these cmdlets in the CTP2,...