PowerShell Team
Automating the world one-liner at a time…
Latest posts
Windows Management Framework 5.0 Preview May 2014 is now available
We’re excited to announce Windows Management Framework 5.0 Preview May 2014, a new package publicizing new and exciting management technologies, is now available for download on Download Center! This version of the preview includes everything in the Windows Management Framework 5.0 Preview that was released in April of 2014 and a new module called PowerShellGet. This new package installs exclusively on Windows 8.1 and Windows Server 2012 R2. If WMF 5.0 Preview (April 2014) is already installed on the machine, WMF 5.0 Preview (April 2014) must be uninstalled in order to install WMF 5.0 Preview ...
Understanding Import-DscResource Keyword in Desired State Configuration
Desired State Configuration resources are used to model and change the state of different components of the system. In an earlier blog post, we discussed details about deploying and discovering those resources and introduced Import-DscResource dynamic keyword. In this post, we will discuss some more details about the usage and internal working of this dynamic keyword. This keyword is only available inside configuration block. Its syntax looks like PowerShell cmdlet but it’s not a cmdlet and behaves differently. When authoring the DSC configuration in ISE, the PowerShell parser, pro...
Debug Mode in Desired State Configuration
The DSC engine caches resources implemented as a PowerShell module for efficiency purposes. This can sometimes turn out to be annoying, when you are authoring a resource and testing it simultaneously. The only way to cause DSC to load the newer version every time is to explicitly kill the process hosting the DSC engine. As part of the WMF5 CTP release, we have introduced a new property for configuring the DSC Local Configuration Manager (LCM) called the DebugMode. When set to true, it causes the engine to reload the PowerShell DSC resource. Once you are done writing your resource, you can set it back to false an...
A World of Scripts at your Fingertips – Introducing Script Browser
<Today we have a guest blog entry from Microsoft Customer Services & Support and the Garage> Update: Version 1.1 of the Script Browser is out. Check out the announcement here: http://blogs.technet.com/b/onescript/archive/2014/04/29/here-comes-the-update-of-script-browser-amp-script-analyzer-1-1.aspx To reuse script samples on the Internet, the following steps seem quite familiar to IT Pros: wandering through different script galleries, forums and blogs, switching back and forth between webpages and scripting environment, and countless download, copy and paste operations. But all of these will d...
Collecting the Output of Remoting Commands
One question we often get around PowerShell Remoting is "How do I collect the output of remoting commands into a different file for each computer?" For example, you want to invoke a remote command across 1,000 machines as a multi-threaded job and then create 1,000 text files for their output. This is in fact impressively easy in PowerShell due to the automatic properties that we add to remote output. The trick is to just know that it exists :) As you can see in the example, we tag remote output with the computer name from which it originated. If we leverage that property, we can now create o...
What’s in a name? Using prefixes in PowerShell.
We’ve talked about this in the past but it’s time for a reminder. PowerShell uses prefixes in front of nouns to avoid name collisions. Imagine how many collisions there would be if people used the noun “USER” directly. Instead, we have cmdlets *-ADUser, *-VPNUser, and *-RDUser. The use of the prefix avoids name collisions. When there is a name collision, the customer must specify the full name of the cmdlet. Did you know that the full name of Get-ADUser was actually ActiveDirectory\Get-ADUser? How would you feel if you had to type that every time you wanted to invoke that command? The use of prefixes ...
Windows Management Framework V5 Preview
The Windows Management Framework V5 Preview is out! Check out Jeffrey Snover's announcement here. The preview contains updates to PowerShell Desired State Configuration, as well as two new features: NetworkSwitch cmdlets and Windows PowerShell OneGet. OneGet is designed to dramatically simplify how you discover and install software packages, while the NetworkSwitch cmdlets allow you to manage Certified for Windows network switches. Check out the announcement page for more details. We're excited to share this preview with you -- let us know what you think. Cheers, PowerShell Team
Configuring an Azure VM using PowerShell DSC
Update 8/7/2014: We just published the Azure PowerShell DSC Extension, which simplifies the configuration of Azure VMs with PowerShell DSC. Please refer to this blog post for more information At the //build/ conference today, Jeffery Snover demonstrated bringing up an Azure virtual machine and configuring it using DSC and the Custom Script VM extension. We are sharing the scripts he used to accomplish this. These scripts present an example of how PowerShell DSC can be used with the Azure boot agent to create and automatically configure Azure VMs. In order to use these scripts you must have an active A...
DSC Resource Kit Wave 3
In September, Microsoft released PowerShell Desired State Configuration (DSC) with twelve built in resources. Three months later (December), we added eight more resources with Wave One of the DSC Resource Kit. Two months after that (February), we totaled fourteen additional resources with Wave Two of the DSC Resource Kit. Can you guess what happens now, the month after the release of Wave Two? We're happy to announce Wave Three of the DSC Resource Kit. This wave contains eighteen new DSC resources. This brings our total count to over 50 DSC Resources -- without even mentio...