Tag Archives: DSC

Setting up the PowerShell.org DSC tools from Github

I have created a short blog series about how to setup the DSC tooling from the PowerShell.org DSC repository. With the mindset of contributing changes.


  1. Test-HomeLab -InputObject ‘The Plan’
  2. Get-Posh-Git | Test-Lab
  3. Get-DSCFramework | Test-Lab
  4. Invoke-DscBuild | Test-Lab
  5. Test-Lab | Update-GitHub

-David Jones


February 2015 NoVa PSUG Meeting Notes

Matt had to cancel so we had a mini-scripting games. Bellow are the challenges.


Challenge 1

Generate a list of US Presidents sorted by last name alphabetically.

Invoke-WebRequest http://www.presidentsusa.net/presvplist.html

Challenge 2

Create a DSC Configuration that verifies the w32time service is set to Automatic startup and is in a Running state.


Some links of note from our discussions:

The next meeting will be on March 25th at the Reston Microsoft Office.

Episode 293 – PowerScripting Podcast – MVP Brian Ehlert from Citrix


In This Episode

Tonight on the PowerScripting Podcast, we talk to Brian Ehlert from Citrix about DSC and XenDesktop




Chatroom Highlights

<JasonMilczek> ##Do you know if Azure Pack is going to be able to provision in Microsoft Azure any time soon?

<Lars_Rasmussen> ### SNover said that even EXEs could be traced

<halr9000> http://itproctology.blogspot.com/

<halr9000> https://www.google.com/maps/place/2115+Jep+Wheeler+Rd,+Woodstock,+GA+30188/@34.1491471,-84.416224,617m/data=!3m1!1e3!4m2!3m1!1s0x88f571b78f6681b5:0xbd70324994bd2272

<halr9000> http://binged.it/1ANUsvp

<halr9000> http://blogs.citrix.com/author/brianeh/

<BrianEh> http://ITProctology.blogspot.com (the MVP blog)

<halr9000> http://www.thecloudcast.net/

<BrianEh> http://www.citrix.com/go/xendesktop-for-the-private-cloud.html

<halr9000> here they are: http://mvp.microsoft.com/en-us/search-mvp.aspx?ex=Remote+Desktop+Services

<halr9000> https://github.com/PowerShellOrg/cHyper-V

<halr9000> http://powershell.org/wp/2014/02/12/episode-258-powerscripting-podcast-jim-britt-from-microsoft-on-service-management-automation/

<halr9000> http://itproctology.blogspot.com/

<halr9000> http://blogs.citrix.com/author/brianeh/

<halr9000> https://chocolatey.org/packages?q=reaper




  • Superhero/Power – the power to convey understanding

Up Next: Brian Ehlert from Citrix talks about XenDesktop and PowerShell DSC


This Thursday, we will be joined by Brian Ehlert from Citrix, author of the XenDesktop Desired State Configuration Resource Provider!

Brian is a Hyper-V MVP since 2007, and writes at blogs.Citrix.com.

If you’d like to see the show live and chat with Jon, Hal, and your fellow scripters, you can join us this Thursday at 9:30 PM EST at live.powerscripting.net.

Episode 290 – PowerScripting Podcast – Jeffrey Snover and John Slack on PowerShell 5.0 (Technical Preview)


In This Episode

Tonight on the PowerScripting Podcast, we talk to Jeffrey Snover and John Slack from Microsoft


Chatroom Highlights

<jsnover> ### HAL what hair products are you using today?

<ehorley> ### curating code?

<sepeck> ## Any known conflicts with things like Exchange or System Center Operations Manager like previous versions of PowerShell had?

<McHelpin> ## or SharePoint??? add on to sepeck

<darylscorner> ## Is Microsoft using WMF5 in the Cloud Platform System

<darylscorner> ## does the previous Sep release have to be removed prior to installing the Nov release, didn’t see anything in the release notes

<halr9000> ##

<organicit> ## any discussions of docker support in the near future?

<MikeFRobbins> ## Will the “x” ever be removed from the DSC resource names? Are they going to be experimental forever?

<sepeck> RobCannon: use ## in front of questions

<sepeck> ## When is the MS Virtual Academy session on PowerShell v5?

<darylscorner> ## upgrade process?

<ehorley> ## How is the pace of change impacting stuff like PDT?

<poshoholic> ## Given Microsoft’s penchant towards open source these days (like .NET, huzzah!), how about open source PowerShell and PowerShell ISE?

<halr9000>  http://ansible.wikia.com/wiki/Han_Tzu

<StephenOwen> Did you guys see this?  Pash?  PowerShell on Bash! http://pash.sourceforge.net/

<MikeFRobbins> Windows Management Framework 5.0 Preview November 2014 is now available http://blogs.msdn.com/b/powershell/archive/2014/11/18/windows-management-framework-5-0-preview-november-2014-is-now-available.aspx

<halr9000> http://www.microsoft.com/en-us/download/details.aspx?id=44987

<MikeFRobbins> Speaking of OneGet, Garrett will be talking about Pester and also about ProGet tomorrow during the OneGet weekly meeting: https://github.com/OneGet/oneget/issues/81

<MikeFRobbins> ProGet is a NuGet package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds. http://inedo.com/proget/overview

<alevyinroc> I’m trying to figure out how this happened https://www.dropbox.com/s/2vk4n12tht5oqmq/Screenshot%202014-11-20%2021.46.40.png?dl=0

<halr9000> https://www.powershellgallery.com/

<MikeFRobbins> http://www.powershellgallery.com/

<GBrayUT> http://www.boxstarter.org/ strings together chocolatey packages

<halr9000> anyway, the joke *was* http://boxstarter.org/package/nr/rickroll

<halr9000> https://chocolatey.org/packages?q=RickRoll

<halr9000> https://chocolatey.org/packages/Astley

<halr9000> and yes Dave_Wyatt it is in show notes, that’s where i found it http://powershell.org/wp/2014/04/15/episode-266-powerscripting-podcast-matt-wrock-from-microsoft-on-boxstarter/

<aupetemc> iex (New-Object Net.WebClient).DownloadString(“http://bit.ly/e0Mw9w “)

<johnslack> http://blogs.msdn.com/b/powershell/archive/2014/11/19/powershell-break-all-command.aspx

<StephenOwen> http://blogs.msdn.com/b/powershell/

<halr9000> http://blogs.msdn.com/b/powershell/

<halr9000> http://powershell.org/wp/2012/01/31/episode-174-matt-graeber-using-powershell-in-infosec/

<halr9000> http://blogs.msdn.com/b/powershell/archive/2014/10/28/powershell-dsc-reskit-wave-8-now-with-100-resources.aspx

<gpduck> http://www.sapien.com/blog/2014/11/14/update-oneget-install-oneget-on-ps-3-0/

<Keith_> @alexandair see the system reqs http://www.microsoft.com/en-us/download/details.aspx?id=44987

<halr9000> http://blogs.msdn.com/b/powershell/archive/2014/10/31/convertfrom-string-example-based-text-parsing.aspx

<GBrayUT> a Docker pull request from Microsoft on github was merged 5 days ago, so a native docker client for controlling remote host systems should be coming soon! https://github.com/docker/docker/pull/9113

<ehorley> PDT = powershell deployment toolkit – https://gallery.technet.microsoft.com/PowerShell-Deployment-f20bb605

<migreene> RE:PDT  http://blogs.technet.com/b/privatecloud/archive/2014/10/24/deployment-dsc-resources-for-system-center-deployment.aspx

<halr9000> http://powershell.org/wp/2013/09/08/episode-239-powerscripting-podcast-rob-willis-from-microsoft-on-the-powershell-deployment-toolkit/

<MikeFRobbins> Speaking of the PowerShell Summit, tickets for the 2015 North America event are now onsale: http://powershell.org/wp/community-events/summit/

<sepeck> https://www.bing.com/maps/default.aspx?encType=1&where1=Turks%20and%20Caicos%20Islands&cp=21.7587261199951~-71.7151489257813&qpvt=turks+and+caicos&FORM=MIRE

<Q_Continuum> http://en.wikipedia.org/wiki/Turks_and_Caicos_Islands

<halr9000> http://en.wikipedia.org/wiki/Turks_and_Caicos_Islands

<jsnover> Here is a link to my wife’s reviews of great places in Turks and Caicos http://www.tripadvisor.com/members-citypage/jsnover/g147399

<jsnover> Here are some of my wife’s photos from the Carribean: http://jo-ann-snover.artistwebsites.com/art/all/caribbean/all

<halr9000> http://jo-ann-snover.artistwebsites.com/featured/sun-dips-below-horizon-on-grace-bay-beach-jo-ann-snover.html

<halr9000> http://snag.gy/Sm5TB.jpg


  • John Slack – power to make food appear at will
  • Jeffrey Snover: favorite vacation spot: Turks & Caicos

Episode 289 – PowerScripting Podcast – Mike Hendrickson and Jason Walker from Microsoft on Configuring Exchange With DSC


In This Episode

Tonight on the PowerScripting Podcast, we talk to Mike Hendrickson and Jason Walker from Microsoft about their DSC resources for Exchange





Chatroom Highlights

<halr9000> http://blogs.technet.com/b/mhendric/archive/2014/10/17/managing-exchange-2013-with-dsc-part-1-introducing-xexchange.aspx

<halr9000> https://msconfiggallery.cloudapp.net/packages/xExchange/

<halr9000> http://blogs.technet.com/b/mhendric/archive/2014/10/17/managing-exchange-2013-with-dsc-part-1-introducing-xexchange.aspx

<Stuwee> DSC Resource Kit Wave 8 : https://gallery.technet.microsoft.com/DSC-Resource-Kit-All-c449312d

<halr9000> https://gist.github.com/halr9000/20ab184a91277f3a2438

<MikeFRobbins> https://github.com/pester/Pester

<MikeFRobbins> Using Pester for Test Driven Development in PowerShell http://mikefrobbins.com/2014/10/09/using-pester-for-test-driven-development-in-powershell/

<halr9000> https://gallery.technet.microsoft.com/DSC-Resource-Kit-All-c449312d

<halr9000> https://msconfiggallery.cloudapp.net/packages/xExchange/

<halr9000> https://gallery.technet.microsoft.com/xExchange-PowerShell-1dd18388/view/Discussions#content

<halr9000> http://blogs.technet.com/b/mhendric/archive/2014/10/17/managing-exchange-2013-with-dsc-part-1-introducing-xexchange.aspx

<MikeFRobbins> My New Book: Windows PowerShell TFM 4th Edition is now Available! http://mikefrobbins.com/2014/11/13/my-new-book-windows-powershell-tfm-4th-edition-is-now-available/

<MikeFRobbins> ## Do you use your resources for only the initial config or to also correct configuration problem with issues occur?

<sepeck> ## but this is an example of how powershell allows for outside ‘unforseen’ contributions to occur within or outside microsoft



  • Mike: Omniscience
  • Jason: Jedi Knight

Episode 288 – PowerScripting Podcast – Hal and Jon talk about Splunk and DSC troubleshooting


In This Episode

Tonight on the PowerScripting Podcast, Hal and Jon talk about Splunk and troubleshooting DSC


<migreene> http://aka.ms/dscmp

<alevyinroc> here’s my screen. https://www.dropbox.com/s/5bz3jqbghjsh2lx/Screenshot%202014-10-23%2021.42.33.png?dl=0

<halr9000> https://apps.splunk.com/app/1477/

<halr9000> wave 7 shipped https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d

<halr9000> wrong link: this one: https://gallery.technet.microsoft.com/xExchange-PowerShell-1dd18388/

<halr9000> http://blogs.citrix.com/2014/10/09/tech-preview-xendesktop-desired-state-configuration-resource-provider/

<rcookiemonster> They did a series on it a short while back – http://blogs.citrix.com/author/brianeh/ has them I think

<halr9000> http://blogs.msdn.com/b/powershell/archive/2014/01/03/using-event-logs-to-diagnose-errors-in-desired-state-configuration.aspx

<halr9000> http://www.ravichaganti.com/blog/portfolio/book-windows-powershell-desired-state-configuration-revealed/

<migreene> https://gallery.technet.microsoft.com/scriptcenter/xDscDiagnostics-PowerShell-abb6bcaa

<JonWalz> https://gallery.technet.microsoft.com/scriptcenter/xDscResourceDesigne-Module-22eddb29

<halr9000> http://blogs.citrix.com/author/brianeh/

Chatroom Highlights:

<Schlauge> ### input inot splunk    key/value pairs?    custom objects?

<Schlauge> ### @JonWalz   did you say you have a resource that pushes your PowerShell profile to a remove computer?

Up Next: Configure Exchange with PowerShell DSC with Jason Walker & Mike Hendrickson!

This Thursday, we will be joined by two excellent guests from Microsoft: Jason Walker, and Mike Hendrickson. They will be talking about a rather large bit of PowerShell DSC code: the xExchange Resource Kit! Mike wrote a blog post series on the topic, and his first piece, Introducing xExchange – Managing Exchange 2013 With DSC – Part 1, starts with “why DSC”, and goes on to examine the contents of this resource kit.

We will talk about it live this Thursday night at 9:30 PM EST, and we would love for you to join us! Viewers of the live stream get to submit questions and interact with their fellow PowerShell peers, so don’t miss out!

The current and future state of the Windows Management Framework

At the 2nd of October, Lee Holmes gave a presentation about the current and future state of the Windows Management Framework (WMF) during the Dutch PowerShell User Group (DuPSUG) at the Microsoft headquarters in The Netherlands.

The slide decks and recorded videos will be made available soon, but this is what was discussed:

The release cycle of the Windows Management Framework (WMF)

Faster incremental releases of preview versions are being released. This rapid development means that companies that need specific new functionalities to tackle current problems they’re having, don’t have to wait as long as they had to in the past.

Everyone should keep in mind that documentation for preview versions can be more limited, but should still read the release notes carefully. They contain descriptions of some of the improvements that are discussed in this blog post, but also cover other things that aren’t discussed here. Also be sure to take a look at What’s New in Windows PowerShell at TechNet.

A request from the audience was to include more helpful real-life examples until documentation is fully up-to-date.


Desired State Configuration (DSC) partial/split configurations

With DSC partial/split configuration it is possible to combine multiple separate DSC configurations to a single desired state. This could be useful when a company has different people or departments that are responsible for a specific part of the configuration (by example Windows, database, applications).



OneGet is a Package Manager Manager (it manages package managers). It enables companies to find, get, install and uninstall packages from both internal and public sources. Public repositories can contain harmful files and should be treated accordingly.

Besides the OneGet module included in the Windows Management Framework Preview, updated versions are continuously being uploaded to https://github.com/OneGet/oneget by Microsoft. These can include bug fixes and new functionality like support for more provider types.

While in the past it seemed that Nuget was required, during the PowerShell Summit it was demonstrated that a file share can be used as well.

From the audience a question was raised whether BITS (Background Intelligent Transfer Service) could be used. This is currently not the case and there were also no plans yet to implement it.



PowerShellGet is a module manager which should make it easier to find the many great modules that are already available, but are not very discoverable because they’re fragmented on numerous websites across the Internet.

Microsoft is currently hosting a gallery of modules. The modules that are available in there are currently being controlled by Microsoft, but this might change in the future.

It is possible to create an internal module source and the save location for modules can be specified as well.



PSReadLine is a bash inspired readline implementation for PowerShell to improve the command line editing experience in the PowerShell.exe console. It includes syntax coloring and CTRL+C and CTRL+V support, for more information about other improvements, view their website.

PSReadLine is one of the modules that can be installed using PowerShellGet:
Find-Module PsReadLine | Install-Module



  • Always be careful when running scripts that include Invoke-Expression or its alias iex because it might run harmful code.
    • For a non harmful example, take a look at this blog post by Lee Holmes.
  • Many people in the security community are adopting PowerShell.
  • PowerShell is done in memory and is therefore volatile. To improve security the following enhancements were introduced:
    • Transcript improvements
      • Transcript support was added to the engine so it can used everywhere, also in the Integrated Scripting Environment (ISE).
      • A transcript file name automatically includes the computer name.
      • Transcript logging can be enforced to be redirected to another system.
      • Transcription can be enforced by default.
  • Group Policy
    • An ADMX file is currently not available to configure it on all platforms, but it can be found in the technical preview versions of Windows 10 and Windows Server under: Administrative Templates -> Windows Components -> Windows PowerShell
  • More advanced Scriptblock logging
    • Enable ScriptBlockLogging through GPO (in later Windows versions) or by registry by setting EnableScriptBlockLogging to 1 (REG_DWORD) in: HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging
    • The additional logging will show you what code was run and can be found in event viewer under Applications and Services Logs\Microsoft\Windows\PowerShell\Operational.
    • Scriptblocks can be split across multiple event log entries due to size limitations.
    • Using Get-WinEvent -FilterHashTable it is possible to get related events, extract the information and combine it.
    • Since attackers would want to remove these registry settings and clear event logs, consider using Windows Event Forwarding/SCOM ACS to store this information on another server. Also consider enabling cmdlet logging.
  • Just Enough Admin (JEA)
    • JEA enables organizations to provide operators with only the amount of access required to perform their tasks.


New and improved functionality and cmdlets


Manage .zip files using Expand-Archive and Compress-Archive

.zip files can be managed using Compress-Archive and Expand-Archive. Other archive types like .rar are not currently supported, but this might be added in future versions.



It is now not necessary anymore to specify the item type. To create a new item, simply run
New-Item foo.txt



This makes it easier to get the value of a file or registry:

  • Get-ItemPropertyValue $Env:windir\system32\calc.exe -name versioninfo
  • Get-ItemPropertyValue-PathHKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\ScriptedDiagnostics -Name ExecutionPolicy


Symbolic links support for New-Item, Remove-Item and Get-ChildItem

Symbolic link files and directories can now be created using:

  • New-Item -ItemType SymbolicLink -Path C:\Temp\MySymLinkFile.txt -Value $pshome\profile.ps1
  • New-Item -ItemType SymbolicLink -Path C:\Temp\MySymLinkDir -Value $pshome

Junctions cannot currently be created, but this might also be added in a later version.


Debugging using Enter-PSHostProcess and Exit-PSHostProcess

Let you debug Windows PowerShell scripts in processes separate from the current process that is running in the Windows PowerShell console (by example long running or looping code). Run Enter-PSHostProcess to enter, or attach to, a specific process ID, and then run Get-Runspace to return the active runspaces within the process. Run Exit-PSHostProcess to detach from the process when you are finished debugging the script within the process.


Use Psedit to edit files in a remote session directly in ISE

Simply open a new PSSession to a remote computer and type PSEdit <path to a file>.


Classes and other user-defined types

    • The goal is to enable a wider range of use cases, simplify development of Windows PowerShell artifacts (such as DSC resources), and accelerate coverage of management surfaces.
    • Classes are useful for structured data. Think by example about custom objects that you need to change afterwards.
    • Name of the class and the constructor must be the same.
    • Code is case insensitive.
    • In classes, variables are lexically scoped (matching braces) instead of dynamically scoped.
    • Every return must be explicit.
    • Sample code:

Class MyClass
  MyClass($int1, $int2)
        “In the constructor”
       return 42








Episode 275 – PowerScripting Podcast – PowerShell MVP Steve Murawski

A Podcast about Windows PowerShell.

In This Episode

Tonight on the PowerScripting Podcast, we talk to Steve Murawski


Guest – Steve Murawski


Chatroom Highlights:

<gpduck> https://github.com/powershellorg/dsc

<halr9000> https://github.com/PowerShellOrg/DSC

<gpduck> also here are links to his talks on DSC from summit: https://www.youtube.com/watch?v=BWR2SVXEpXk

<gpduck> https://www.youtube.com/watch?v=nkKyfsy-iQA

<gpduck> https://www.youtube.com/watch?v=JAzjf4sQvro

<randal_hicks> http://technet.microsoft.com/en-us/library/dn249912.aspx

<randal_hicks> https://github.com/PowerShellOrg/DSC

<JonWalz> this is my favorite one-page post about the Summit http://curah.microsoft.com/67912/powershell-summit-na-2014

<halr9000> https://github.com/PowerShellOrg/DSC/tree/master/Resources/StackExchangeResources/DSCResources

<ehorley> Hum, limited to IPv4 only in https://github.com/PowerShellOrg/DSC/blob/master/Resources/cNetworking/DSCResources/PSHOrg_cIPAddress/PSHOrg_cIPAddress.psm1

<halr9000> http://msdn.microsoft.com/en-us/library/dd878343(v=vs.85).aspx

<halr9000> here ya go ehorley https://github.com/PowerShellOrg/DSC/issues/new

<halr9000> https://github.com/PowerShellOrg/DSC/blob/master/Tooling/DscDevelopment/New-MofFile.ps1

<halr9000> https://github.com/PowerShellOrg/DSC/issues/26

* Vern_Anderson ([email protected]) has quit IRC (Quit:  HydraIRC -> http://www.hydrairc.com <- Nine out of ten l33t h4x0rz prefer it)

<ehorley> Might have to try and make the Lisa event – https://www.usenix.org/conference/lisa14

<KC1> ORGANICIT – see http://powershell.org/wp/2013/10/03/building-a-desired-state-configuration-pull-server/

<KC1> http://davewyatt.wordpress.com/2014/06/07/how-to-install-a-dsc-pull-server-on-windows-2008-r2/

<halr9000> http://stevenmurawski.com/

<halr9000> http://www.opsallthethings.com/

<randal_hicks> https://twitter.com/StevenMurawski

<stevenmurawski> https://twitter.com/therubyrep

<gpduck> https://twitter.com/opsallthethings

<JonWalz> http://www.zombiepodcast.com/

<halr9000> http://scottsigler.com/

<stevenmurawski> http://www.arresteddevops.com/

<stevenmurawski> http://theshipshow.com/

<gpduck> ## steven you need to talk to jason helmick about how those tutorials work and possibly doing something similar at summit next year

<logicaldiagram> ## You’ll still manage the powershell.org repo then?

<Vern_Anderson> ## Do you use System Center?

<KC1> ##I really like the git hub feel and his code seems organized and clear. Was the ability to organize it into levels why he chose github over poshcode? Or is PoshCode more for random scripts? Apologies if this question was already asked/answered

<JasonMor_> ## but you have to run that twice right?

<organicit> ## maybe someone already asked but can Steve elaborate on what he uses for a build server?

The Question – what was the first task you completed with PowerShell?

  • resetting user passwords in AD

Tonight on the podcast–Jeffrey Snover!

Hi everyone, it’s summer and we are recording on Wednesday. Don’t forget to drop by tonight of all nights, because we are pleased to have Jeffrey Snover back again! Topics include JEA, software defined datacenter, DSC for Linux, and anything else that YOU want to talk about!

You can join us live at 9:30 PM at live.powerscripting.net and ask questions of the inventor of PowerShell, and architect of Windows Server and System Center. Don’t miss it!

DSC Pull Server on Windows Server 2008 R2

Recently on the PowerShell.org forums, a community member mentioned that they were having trouble setting up a Server 2008 R2 machine as a DSC pull server. It turns out, this is possible, but you have to install all the prerequisites yourself, since the Add-WindowsFeature DSC-Service command doesn’t do it for you on the older operating system.

Refer to this blog post for the checklist.

Patterns for Implementing a DSC Pull Server Environment

My Patterns for Implementing a DSC Pull Server Environment talk from the PowerShell Summit is now online.


Building Scalable Configurations With DSC

My Building Scalable Configurations with DSC talk from the PowerShell Summit is now online.