header image

Archive for March, 2014

DSC resource kit wave 3

Posted by: | March 31, 2014 | No Comment |

Desired State Configuration (DSC) is the new server configuration and compliance mechanism that ships with PowerShell 4.0 and Windows Server 2012 R2. Resources are the way you perform configuration. Now you have more options with the release of wave 3 of the DSC resource kit. Details from http://blogs.msdn.com/b/powershell/archive/2014/03/28/dsc-resource-kit-wave-3.aspx

under: PowerShell v4, Windows 2012 R2

Reaching the end of March there’s not much time left to register for the PowerShell Summit NA 2014 – http://powershell.org/wp/community-events/summit/powershell-summit-north-america/summit-registration/   as its coming up fast. See you there.

under: PowerShell original, PowerShell Summit

Discovering namespaces

Posted by: | March 28, 2014 | No Comment |

Next point on the journey of discovery through CIM is finding the namespaces installed on a machine.  I showed how to do this using Get-WmiObject in PowerShell and WMI but this time round decided to come up to date and use Get-CimInstance function get-cimnamespace { param ( [string]$namespace = ‘root/cimv2’ ) Get-CimInstance -ClassName __NameSpace -Namespace […]

under: PowerShell and CIM, PowerShell and WMI, PowerShell V3, PowerShell v4

I recently showed how to create a function that could be used to simplify the use of Get-CimClass. In this version I’ve added some features: – parameter validation – namespace – try-catch round getting the class information. This turns the code into: function Get-CimMethod { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] [Alias("Class")] [ValidateNotNullOrEmpty()] [string]$classname, [ValidateNotNullOrEmpty()] [string]$namespace = […]

under: PowerShell and CIM, PowerShell and WMI, PowerShell V3, PowerShell v4

Tomorrow – 26 March – several PowerShell books will feature in Manning’s Deal of the Day: PowerShell in Depth 2E PowerShell and WMI PowerShell Deep Dives   All highly recommended and full of PowerShell goodness

under: Books, PowerShell original

One thing I really like about the PowerShell community is the number of people who share information and the way that allows us to incrementally increase our knowledge and skills. This can lead to the situation where you can take ideas from two very separate people, from two different times and put them together to […]

under: PowerShell Basics

As you’ve probably gathered I spend a lot of time working with, and investigating, CIM (WMI) classes. CIM and WMI will be treated as synonymous for these articles. If you want to discover the methods available on a CIM class you can do this: $class = Get-CimClass -ClassName Win32_Process $class.CimClassMethods If you want to drill […]

under: PowerShell and CIM, PowerShell and WMI, PowerShell V3, PowerShell v4

Windows 2012 R2 GA (General Availability) occurred in October 2013. Downloads of the Windows 2012 R2 RTM release were made available on MSDN before that time however there were some changes made between RTM and GA that have a significant impact on Desired State Configuration – it breaks on most code you will find. The […]

under: Windows 2012 R2

Where’s the value

Posted by: | March 20, 2014 | No Comment |

PowerShell is object based – its the one fact that is mentioned in very introduction to PowerShell – and its the use of objects that gives PowerShell its reach and power. The use of objects has one tiny drawback. When you want the actual value of a property you have to do slightly more work. […]

under: PowerShell Basics

Give me a break

Posted by: | March 19, 2014 | No Comment |

Having shown how to use continue last time I thought I’d show the opposite functionality this time and demonstrate how to jump out of a loop. You do this using the break command.  The following examples show how it works. What do you think the output of these loops will be? FOR loop for ($i=1; […]

under: PowerShell Basics

Older Posts »