DSC Resource Kit Release April 2017

Katie Keim [MSFT]

We just released the DSC Resource Kit!

This release includes updates to 5 DSC resource modules, including 3 new DSC resources. In these past 6 weeks, 57 pull requests have been merged and 46 issues have been closed, all thanks to our amazing community!

The modules updated in this release are:

  • PSDscResources
  • xCertificate
  • xDatabase
  • xPSDesiredStateConfiguration
  • xSQLServer

For a detailed list of the resource modules and fixes in this release, see the Included in this Release section below.

Our last community call for the DSC Resource Kit was last week on April 12. A recording of our updates as well as summarizing notes are available. Join us next time on May 24 to ask questions and give feedback about your experience with the DSC Resource Kit. Keep an eye on the community agenda for the link to the call.

We strongly encourage you to update to the newest version of all modules using the PowerShell Gallery, and don’t forget to give us your feedback in the comments below, on GitHub, or on Twitter (@PowerShell_Team)!

All resources with the ‘x’ prefix in their names are still experimental – this means that those resources are provided AS IS and are not supported through any Microsoft support program or service. If you find a problem with a resource, please file an issue on GitHub.

Included in this Release

You can see a detailed summary of all changes included in this release in the table below. For past release notes, go to the README.md or Changelog.md file on the GitHub repository page for a specific module (see the How to Find DSC Resource Modules on GitHub section below for details on finding the GitHub page for a specific module).

Module Name Version Release Notes
  • Archive:
    • Fixed a minor bug in the unit tests where sometimes the incorrect DateTime format was used.
  • Added MsiPackage
  • Fixed issue where xCertReq does not process requested certificate when credentials parameter set and PSDscRunAsCredential not passed. See issue
  • Moved internal functions to a common helper module
  • xMsiPackage:
    • Created high quality MSI package manager resource
  • xArchive:
    • Fixed a minor bug in the unit tests where sometimes the incorrect DateTime format was used.
  • xWindowsFeatureSet:
    • Had the wrong parameter name in one test case.
  • Examples
    • xSQLServerDatabaseRole
      • 1-AddDatabaseRole.ps1
      • 2-RemoveDatabaseRole.ps1
    • xSQLServerRole
      • 3-AddMembersToServerRole.ps1
      • 4-MembersToIncludeInServerRole.ps1
      • 5-MembersToExcludeInServerRole.ps1
    • xSQLServerSetup
      • 1-InstallDefaultInstanceSingleServer.ps1
      • 2-InstallNamedInstanceSingleServer.ps1
      • 3-InstallNamedInstanceSingleServerFromUncPathUsingSourceCredential.ps1
      • 4-InstallNamedInstanceInFailoverClusterFirstNode.ps1
      • 5-InstallNamedInstanceInFailoverClusterSecondNode.ps1
    • xSQLServerReplication
      • 1-ConfigureInstanceAsDistributor.ps1
      • 2-ConfigureInstanceAsPublisher.ps1
    • xSQLServerNetwork
      • 1-EnableTcpIpOnCustomStaticPort.ps1
    • xSQLServerAvailabilityGroupListener
      • 1-AddAvailabilityGroupListenerWithSameNameAsVCO.ps1
      • 2-AddAvailabilityGroupListenerWithDifferentNameAsVCO.ps1
      • 3-RemoveAvailabilityGroupListenerWithSameNameAsVCO.ps1
      • 4-RemoveAvailabilityGroupListenerWithDifferentNameAsVCO.ps1
      • 5-AddAvailabilityGroupListenerUsingDHCPWithDefaultServerSubnet.ps1
      • 6-AddAvailabilityGroupListenerUsingDHCPWithSpecificSubnet.ps1
    • xSQLServerEndpointPermission
      • 1-AddConnectPermission.ps1
      • 2-RemoveConnectPermission.ps1
      • 3-AddConnectPermissionToAlwaysOnPrimaryAndSecondaryReplicaEachWithDifferentSqlServiceAccounts.ps1
      • 4-RemoveConnectPermissionToAlwaysOnPrimaryAndSecondaryReplicaEachWithDifferentSqlServiceAccounts.ps1
    • xSQLServerPermission
      • 1-AddServerPermissionForLogin.ps1
      • 2-RemoveServerPermissionForLogin.ps1
    • xSQLServerEndpointState
      • 1-MakeSureEndpointIsStarted.ps1
      • 2-MakeSureEndpointIsStopped.ps1
    • xSQLServerConfiguration
      • 1-ConfigureTwoInstancesOnTheSameServerToEnableClr.ps1
      • 2-ConfigureInstanceToEnablePriorityBoost.ps1
    • xSQLServerEndpoint
      • 1-CreateEndpointWithDefaultValues.ps1
      • 2-CreateEndpointWithSpecificPortAndIPAddress.ps1
      • 3-RemoveEndpoint.ps1
  • Changes to xSQLServerDatabaseRole
    • Fixed code style, added updated parameter descriptions to schema.mof and README.md.
  • Changes to xSQLServer
    • Raised the CodeCov target to 70% which is the minimum and required target for HQRM resource.
  • Changes to xSQLServerRole
    • BREAKING CHANGE: The resource has been reworked in it”s entirely.* Below is what has changed.
    • The mandatory parameters now also include ServerRoleName.
    • The ServerRole parameter wasbefore an array of server roles, now this parameter is renamed to ServerRoleName and can only be set to one server role.
      • ServerRoleName are no longer limited to built-in server roles. To add members to a built-in server role, set ServerRoleName to the name of the built-in server role.
      • The ServerRoleName will be created when Ensure is set to “Present” (if it does not already exist), or removed if Ensure is set to “Absent”.
    • Three new parameters are added; Members, MembersToInclude and MembersToExclude.
      • Members can be set to one or more logins, and those will replace all the memberships in the server role.
      • MembersToInclude and MembersToExcludecan be set to one or more logins that will add or remove memberships, respectively, in the server role. MembersToInclude and MembersToExclude can not be used at the same time as parameter Members. But both MembersToInclude and MembersToExclude can be used together at the same time.
  • Changes to xSQLServerSetup
    • Added a note to the README.md saying that it is not possible to add or remove features from a SQL Server failover cluster (issue 433).
    • Changed so that it reports false if the desired state is not correct (issue 432).
      • Added a test to make sure we always return false if a SQL Server failover cluster is missing features.
    • Helperfunction Connect-SQLAnalysis
      • Now has correct error handling, and throw does not used the unknown named parameter “-Message” (issue 436)
      • Added tests for Connect-SQLAnalysis
      • Changed to localized error messages.
      • Minor changes to error handling.
    • This adds better support for Addnode (issue 369).
    • Now it skips cluster validation för add node (issue 442).
    • Now it ignores parameters that are not allowed for action Addnode (issue 441).
    • Added support for vNext CTP 1.4 (issue 472).
  • Added newresource
    • xSQLServerAlwaysOnAvailabilityGroupReplica
  • Changes to xSQLServerDatabaseRecoveryModel
    • Fixed code style, removed SQLServerDatabaseRecoveryModel functions from xSQLServerHelper.
  • Changes to xSQLServerAlwaysOnAvailabilityGroup
    • Fixed the permissions check loop so that it exits the loop after the function determines the required permissions are in place.
  • Changes to xSQLServerAvailabilityGroupListener
    • Removed the dependency of SQLPS provider (issue 460).
    • Cleaned up code.
    • Added test for more coverage.
    • Fixed PSSA rule warnings (issue 255).
    • Parameter Ensure now defaults to “Present” (issue 450).
  • Changes to xSQLServerFirewall
    • Now it will correctly create rules when the resource is used for two or more instances on the same server (issue 461).
  • Changes to xSQLServerEndpointPermission
    • Added description to the README.md
    • Cleaned up code (issue 257 and issue 231)
    • Now the default value for Ensure is “Present”.
    • Removed dependency of SQLPS provider (issue 483).
    • Refactored tests so they use less code.
  • Changes to README.md
    • Adding deprecated tag to xSQLServerFailoverClusterSetup, xSQLAOGroupEnsure and xSQLAOGroupJoin in README.md so it it more clear that these resources has been replaced by xSQLServerSetup, xSQLServerAlwaysOnAvailabilityGroup and xSQLServerAlwaysOnAvailabilityGroupReplica respectively.
  • Changes to xSQLServerEndpoint
    • BREAKING CHANGE: Now SQLInstanceName is mandatory, and is a key, so SQLInstanceName has no longer a default value (issue 279).
    • BREAKING CHANGE: Parameter AuthorizedUser has been removed (issue 466, issue 275 and issue 80). Connect permissions can be set using the resource xSQLServerEndpointPermission.
    • Optional parameter IpAddress has been added. Default is to listen on any valid IP-address. (issue 232)
    • Parameter Port now has a default value of 5022.
    • Parameter Ensure now defaults to “Present”.
    • Resource now supports changing IP address and changing port.
    • Added unit tests (issue 289)
    • Added examples.
  • Changes to xSQLServerEndpointState
    • Cleaned up code, removed SupportsShouldProcess and fixed PSSA rules warnings (issue 258 and issue 230).
    • Now the default value for the parameter State is “Started”.
    • Updated README.md with a description for the resources and revised the parameter descriptions.
    • Removed dependency of SQLPS provider (issue 481).
    • The parameter NodeName is no longer mandatory and has now the default value of $env:COMPUTERNAME.
    • The parameter Name is now a key so it is now possible to change the state on more than one endpoint on the same instance. Note: The resource still only supports Database Mirror endpoints at this time.
  • Changes to xSQLServerHelper module
    • Removing helper function Get-SQLAlwaysOnEndpoint because there is no resource using it any longer.
    • BREAKING CHANGE: Changed helper function Import-SQLPSModule to support SqlServer module (issue 91). The SqlServer module is the preferred module so if it is found it will be used, and if not found an attempt will be done to load SQLPS module instead.
  • Changes to xSQLServerScript
    • Updated tests for this resource, because they failed when Import-SQLPSModule was updated.

How to Find Released DSC Resource Modules

To see a list of all released DSC Resource Kit modules, go to the PowerShell Gallery and display all modules tagged as DSCResourceKit. You can also enter a module’s name in the search box in the upper right corner of the PowerShell Gallery to find a specific module.

Of course, you can also always use PowerShellGet (available in WMF 5.0) to find modules with DSC Resources:

# To list all modules that are part of the DSC Resource Kit
Find-Module -Tag DSCResourceKit 
# To list all DSC resources from all sources 

To find a specific module, go directly to its URL on the PowerShell Gallery: http://www.powershellgallery.com/packages/< module name > For example: http://www.powershellgallery.com/packages/xWebAdministration

We recommend that you use PowerShellGet to install DSC resource modules:

Install-Module -Name < module name >

For example:

Install-Module -Name xWebAdministration

To update all previously installed modules at once, open an elevated PowerShell prompt and use this command:


After installing modules, you can discover all DSC resources available to your local system with this command:


How to Find DSC Resource Modules on GitHub

All resource modules in the DSC Resource Kit are available open-source on GitHub. You can see the most recent state of a resource module by visiting its GitHub page at: https://github.com/PowerShell/< module name > For example, for the xCertificate module, go to: https://github.com/PowerShell/xCertificate.

All DSC modules are also listed as submodules of the DscResources repository in the xDscResources folder.

How to Contribute

You are more than welcome to contribute to the development of the DSC Resource Kit! There are several different ways you can help. You can create new DSC resources or modules, add test automation, improve documentation, fix existing issues, or open new ones. See our contributing guide for more info on how to become a DSC Resource Kit contributor.

If you would like to help, please take a look at the list of open issues for the DscResources repository. You can also check issues for specific resource modules by going to: https://github.com/PowerShell/< module name >/issues For example: https://github.com/PowerShell/xPSDesiredStateConfiguration/issues

Your help in developing the DSC Resource Kit is invaluable to us!

Questions, comments?

If you’re looking into using PowerShell DSC, have questions or issues with a current resource, or would like a new resource, let us know in the comments below, on Twitter (@PowerShell_Team), or by creating an issue on GitHub.

Katie Keim Software Engineer PowerShell Team @katiedsc (Twitter) @kwirkykat (GitHub)


Discussion is closed.

Feedback usabilla icon