Wilson Mar bio photo

Wilson Mar

Hello. Hire me!

Email me Calendar Skype call 310 320-7878

LinkedIn Twitter Gitter Google+ Youtube

Github Stackoverflow Pinterest

Let PowerShell make it right and keep it right


This article describes the use of Windows PowerShell Desired State Configuration (DSC). introduced by PowerShell.

“PowerShell” refers to both the command-line shell and scripting language designed system administration.

Built on the .NET Framework, Windows PowerShell helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.

Windows PowerShell cmdlets (command-lets) enables computers to be managed from the command line, much like Bash on Linux machines.

However, PowerShell offers much more consistence than the various commands added over time by various parties.

  • It reads Excel files natively as well as JSON, XML, and even ASCII.

DSC resources can be obtained from several places:

  • GitHub
  • PowerShell Gallery
  • PowerShell Package Manager (of PowerShell modules)

Open source on Linux and MacOS

From the PowerShell and DSC Team YouTube channel:

This 51-minute series of demos was published Aug 18, 2016.

This article notes Desired State Configuration for Linux and the promise of SSH support arrived in 2014 (several months before Microsoft open sourced .NET and brought .NET Core to Linux). But “you had to author your scripts on the Windows platform, you had to configure things on the Windows platform and then deliver the desired configuration to a Linux box and have it be configured; now you can do all of that on Linux.”

On August 18 2016, PowerShell became open-source at

Join the conversation on Gitter

Noteworthy pages in the FAQ:

  • https://blogs.msdn.microsoft.com/kebab/2013/06/09/an-introduction-to-error-handling-in-powershell/
  • http://ss64.com/ps/syntax.html
  • https://github.com/PoshCode/PowerShellPracticeAndStyle

Deploy as MOF

MOF is a file extension for a Windows Management Object file format.

MOF files created in the Managed Object Format have syntax based on Microsoft Visual C++.

MOF files can be compiled into the Windows Management Instrumentation (WMI) repository using mofcomp.exe.

MOF files often have a partner DLL (dynamic link library) file that stores data needed for retrieval in the MOF file.

Chef incorporates DSC

Infrastructure as Code

Ravikanth Chaganti (MVP) (of PowerShell Magazine and book PowerShell Desired State Configuration Revealed) notes that “Infrastructure as Code” requires:

  • Reusable automation
  • Source Control
  • Unit Testing
  • Continuous Deployment
  • Integration tests, which validate the desired state
  • Operations Validation, which validates the functionality at desired state!

Operation Validation Framework


Get-Command -Module OperationValidation

It has two functions:

Get-OperationValidation to Retrieve operational tests from modules

Invoke-OperationValidation to run operational tests from modules




Practical Desired State Configuration (DSC) [3:01] 10 Aug 2016 by Josh Duffney

http://stackoverflow.com/questions/8153750/how-to-search-a-string-in-multiple-files-and-return-the-names-of-files-in-powers How to search a string in multiple files and return the names of files in Powershell

More on API Microservices

This is one of a series:

More on DevOps

This is one of a series on DevOps:

  1. DevOps_2.0
  2. ci-cd (Continuous Integration and Continuous Delivery)
  3. User Stories for DevOps

  4. Git and GitHub vs File Archival
  5. Git Commands and Statuses
  6. Git Commit, Tag, Push
  7. Git Utilities
  8. Data Security GitHub
  9. GitHub API
  10. TFS vs. GitHub

  11. Choices for DevOps Technologies
  12. Java DevOps Workflow
  13. AWS DevOps (CodeCommit, CodePipeline, CodeDeploy)
  14. AWS server deployment options

  15. Digital Ocean
  16. Cloud regions
  17. AWS Virtual Private Cloud
  18. Azure Cloud Onramp
  19. Azure Cloud
  20. Azure Cloud Powershell

  21. Powershell Ecosystem
  22. Powershell on MacOS
  23. Powershell Desired System Configuration

  24. Jenkins Server Setup
  25. Jenkins Plug-ins
  26. Jenkins Freestyle jobs
  27. Jenkins2 Pipeline jobs using Groovy code in Jenkinsfile

  28. Dockerize apps
  29. Docker Setup
  30. Docker Build

  31. Maven on MacOSX

  32. Ansible

  33. MySQL Setup

  34. SonarQube static code scan

  35. API Management Microsoft
  36. API Management Amazon

  37. Scenarios for load