PowerShell Team
Automating the world one-liner at a time…
Latest posts
Hungry for more Windows PowerShell Desired State Configuration Resources?
Now that you understand the value and need of Windows PowerShell Desired State Configuration (DSC), and how to declaratively express the intent of machine configuration via the new configuration keyword, you might be wondering how the configuration happens. Configuration on a machine works because of DSC resources. Windows Server 2012 R2 and Windows Management Framework (WMF) 4.0 come with 12 built-in resources, but that’s not all. Like command extensibility of PowerShell, DSC resources are also extensible–you can create new DSC resources to fill the gap. This blog will walk you through the mechanics ...
Understanding CONFIGURATION keyword in Desired State Configuration
Desired State Configuration is a new management platform in Windows Powershell that enables devOps scenarios on Windows. It enables system administrators and devOps to configure a system declaratively, enforce the configuration and reuse configuration. One core aspect of it is the language extension for Configuration keyword in Powershell. You can express configurations of your machine using configuration keyword as shown below which is taken from the MSDN documentation Configuration MyWebConfig { # A Configuration block can have zero or more Node blocks Node "Server001" { ...
Seeking Input on PowerShell Summit Sessions
One of the best things about PowerShell is its strong community. Events like the annual PowerShell Summit are a great way to get involved and learn more about PowerShell. As in the past, the PowerShell team will present several sessions at the PowerShell Summit. This year, we want to get your input on the sessions that we will present. Here is a list of sessions under consideration so far: Which ones catch your interest? Are there any that we’re missing? Let us know in the comments. For more information about the Summit: http://powershell.org/wp/community-events/summit/ Th...
Configuration in a DevOps world – Windows PowerShell Desired State Configuration
Some background A new breed of configuration management tools has been created to manage the platforms, applications, and infrastructure of the cloud, and keep the cloud running with high availability. The need for these new tools and infrastructure comes from the increase in scale, rapid rate of change, and complexity of the cloud. But existing tools have limited support for Windows. Windows PowerShell Desired State Configuration (DSC) provides a configuration platform built into Windows that is based on open standards. DSC is flexible enough to function reliably and consistently in each stage of t...
PaaP: Windows PowerShell as a Platform – Part 2
In the previous post for this series, we saw how System.Management.Automation.PowerShell class can be used to run PowerShell commands in a C# application. In all those cases, the runspace that we used was created in a default manner. In this post, we'll look at ways to customize the runspace that we create to execute the commands. Why do we need to customize the runspace? For example, there could be scenarios where you don’t want the user to be able to run a particular command that could change the state of the machine. In that case, you can create a runspace without that command and now, the user does not have a...
Using abstract syntax trees (ASTs) with ISE to make scripting more productive
One thing I really like about Windows PowerShell ISE is its ability to expose its underlying script object model, to allow users to customize the scripting experience to suit their style and need. At the heart of customizing ISE is the $psISE object. The $psISE object allows you to control the various functional aspects of ISE. You can get a good description of the hierarchical object model for $psISE, and an exhaustive list of available features associated with this object here. This post discusses how you can leverage the power of PowerShell's publicly-available parser APIs, and combine that power with the ISE...
WMF 4.0 – Known Issue: Partial Installation without .NET Framework 4.5
With the release of Windows Management Framework 4.0 (WMF 4.0), our package that lets you use management technologies from Windows 8.1 and Windows Server 2012 R2 on some of Microsoft’s older operating systems, we have been hearing one question fairly often. I’d like to address it here, so that there can be more self-help, and hopefully I can help preempt some occurrences of this issue. Scenario: Installing WMF 4.0 on a computer that is not running .NET Framework 4.5 will report that the installation is successful, but the components of WMF 4.0 (such as Windows PowerShell, WMI, etc.) will not be update...
Windows Management Framework 4.0 is now available
Windows Management Framework 4.0, our package that lets you use management technologies from Windows 8.1 and Windows Server 2012 R2 on some of Microsoft’s older operating systems, is now available for you to download and install. This full-release version of Windows Management Framework 4.0 includes even more improvements than our Preview release. Be certain to read this blog post fully before installing, especially because WMF 4.0 is not compatible with certain versions of server products. Windows Management Framework 4.0 Preview was made publicly available in July, and we were very excited to talk with co...
PaaP: Windows PowerShell as a Platform – Part 1
In addition to being a scripting language, Windows PowerShell is also used as a platform in many applications. This is possible because the Windows PowerShell engine can be hosted inside an application. This blog post and the next will deal with the various APIs available for hosting Windows PowerShell in a C# application. The most important type for hosting Windows PowerShell is the System.Management.Automation.PowerShell class. This class provides methods that create a pipeline of commands and then execute those commands in a runspace. AddCommand Let's take a very simple example. Suppose you want to get th...