PowerShell Team
Automating the world one-liner at a time…
Latest posts
Workaround for Add-Member on plain .Net objects
Introduction While I was fixing bugs, I came across an interesting bug (https://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=382818) that seemed to have a very simple fix upon first glance. However, after doing some more research, I found out that it was actually very tricky to fix the root cause. If you do the following: $table = @{ key1="val1"; key2="val2" } Add-Member -in $table -MemberType NoteProperty -Name test -Value testValue Now if you pipe $table to Get-Member you will notice that the test property is missing. No matter how many times you repeat t...
Quick, Dirty, Super-Useful Scripting
Last weekend I installed the super-awesome W7 Ultimate on all the machines at home. This weekend I decided to install the XP Virtual mode download. I started to do this and noticed that it was 500MB. That is large and is going to take a long time FOR EACH PC I have. One of the reasons I got the Ultimate SKU is that it has BranchCache. This is EXACTLY what Branchcache was designed to do. One PC downloads something and puts it into a distributed cache and then when the other PCs go to download it, they get it from their peers instead of from the internet (given the way my son rea...
Sending Automated emails with Send-MailMessage, ConvertTo-HTML, and the PowerShellPack’s TaskScheduler module
On October 15th I released a large collection of scripts called the PowerShellPack. The PowerShellPack has tons of PowerShell V2 scripts that can be used to do all sorts of fun and practical things. Today, we’ll show how to use a module in the PowerShell Pack to schedule sending a daily automated email with information about the installed programs on a given system. Turning the output of a PowerShell script into an automated email is a snap in PowerShell V2, thanks to a nifty new cmdlet called Send-MailMessage. Send-MailMessage sends out emails with the credentials of the current user (or an ar...
Windows Management Framework is here!
Windows Management Framework, which includes Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0, was officially released to the world this morning. By providing a consistent management interface across the various flavors of Windows, we are making our platform that much more attractive to deploy. IT Professionals can now easily manage their Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 machines through PowerShell remoting – that’s a huge win! You can download the packages here: http://go.microsoft.com/fwlink/?LinkID=151321 Lee Holmes [MSFT]
Tonight is the Virtual Launch Party @ PowerScripting Podcast
Tonight is the night! I was super happy when we shipped V1 of PowerShell. It started the journey. That said, V2 is the release that we really wanted to release. Today Windows 7 is publicly available and every version has PowerShell V2 in it. Tonight – we party! I’ll be cracking a beer with Hal Rottenberg and Jonathan Walz (hosts of the PowerScripting Podcast) in a PowerShell V2 Virtual Launch Party tonight at 9:30 PM EDT (GMT-4). For more details and info on how to join us go HERE. I’m looking forward to seeing you. Note, you can always watch the podcast af...
PowerShell V2 Virtual Launch Party
I’ll be joining Hal Rottenberg and Jonathan Walz (hosts of the PowerScripting Podcast) in a PowerShell V2 Virtual Launch Party this Thursday, Oct 22nd, 9:30 PM EDT (GMT-4). For more details and info on how to join us go HERE. Hmmm, I wonder if it is BYOB… :-) Experiment! Enjoy! Engage! Jeffrey Snover [MSFT] Distinguished Engineer Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
Announcing: Open Source PowerShell Cmdlet and Help Designer
http://www.codeplex.com/CmdletDesigner During the development of Windows 7, most cmdlet design and help authoring in Microsoft went through an internal tool called the “Cmdlet Designer.” The Cmdlet Designer makes it much easier for teams to concentrate on the design, naming, and consistency of their cmdlets, while also guaranteeing name registration and collision avoidance across Microsoft. To sweeten the deal, it offers: So why blog about it? Because it’s now yours! We just posted the entirety of the Cmdlet Designer, its source code, design specification, and deployment guide to ht...
Introducing the Windows 7 Resource Kit PowerShell Pack
Since I work on the PowerShell team, I’ve been lucky enough to get a couple of years jump start on producing PowerShell V2 scripts and modules. With every new script I write in V2 I get more and more amazed by the possibilities in PowerShell. I’ve discovered how to do many cool things that, as some of my colleagues outside of the PowerShell team have put it, have showed them the Power of PowerShell. At each CTP of PowerShell, I’ve tried to share this power of PowerShell here on this blog. Thanks to Mitch Tulloch (the main author of the Windows 7 Resource Kit) and Ed Wilson (the Scripting Guy), I...
What's Up With Command Prefixes?
We like to say that PowerShell uses Verb-Noun naming. If we were accurate, we would say that PowerShell uses Verb-PrefixNoun naming. For instance: Get-WinEvent . WIN is a prefix for Windows. Every now and again people look at this and ask “what's up with command prefixes ?!?”. Actually, the question usually comes from teams that are implementing Cmdlets and don't understand why they have to use prefixes. They sometimes feel like their noun is unique or they want to own the noun or they think they may get reorganized into a different group so they are not sure what a good prefix...