PSDscResources is the new home of the in-box resources from PSDesiredStateConfiguration.
These resources are a combination of those in the in-box PSDesiredStateConfiguration module as well as community contributions from our experimental xPSDesiredStateConfiguration module on GitHub. These resources have also recently been updated to meet the DSC Resource Kit High Quality Resource Module (HQRM) guidelines.
In-box resources not currently included in this module should not be affected and can still load from the in-box PSDesiredStateConfiguration module.
Because PSDscResources overwrites in-box resources, it is only available for WMF 5.1. Many of the resource updates provided here are also included in the xPSDesiredStateConfiguration module which is still compatible with WMF 4 and WMF 5 (though this module is not supported and may be removed in the future).
To update your in-box resources to the newest versions provided by PSDscResources, first install PSDscResources from the PowerShell Gallery:
Install-Module PSDscResources
Then, simply add this line to your DSC configuration:
Import-DscResource -ModuleName PSDscResources
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
This module does not accept breaking changes.
Please check out the common DSC Resources contributing guidelines.
- Group: Provides a mechanism to manage local groups on a target node.
- Service: Provides a mechanism to configure and manage Windows services on a target node.
- User: Provides a mechanism to manage local users on a target node.
- WindowsFeature: Provides a mechanism to install or uninstall windows roles or features on a target node.
- WindowsOptionalFeature: Provides a mechanism to enable or disable optional features on a target node.
- WindowsPackageCab: Provides a mechanism to install or uninstall a package from a windows cabinet (cab) file on a target node.
Provides a mechanism to manage local groups on a target node. This resource works on Nano Server.
None
- [String] GroupName (Key): The name of the group to create, modify, or remove.
- [String] Ensure (Write): Indicates if the group should exist or not. To add a group or modify an existing group, set this property to Present. To remove a group, set this property to Absent. The default value is Present. { Present | Absent }.
- [String] Description (Write): The description the group should have.
- [String[]] Members (Write): The members the group should have. This property will replace all the current group members with the specified members. Members should be specified as strings in the format of their domain qualified name (domain\username), their UPN (username@domainname), their distinguished name (CN=username,DC=...), or their username (for local machine accounts). Using either the MembersToExclude or MembersToInclude properties in the same configuration as this property will generate an error.
- [String[]] MembersToInclude (Write): The members the group should include. This property will only add members to a group. Members should be specified as strings in the format of their domain qualified name (domain\username), their UPN (username@domainname), their distinguished name (CN=username,DC=...), or their username (for local machine accounts). Using the Members property in the same configuration as this property will generate an error.
- [String[]] MembersToExclude (Write): The members the group should exclude. This property will only remove members from a group. Members should be specified as strings in the format of their domain qualified name (domain\username), their UPN (username@domainname), their distinguished name (CN=username,DC=...), or their username (for local machine accounts). Using the Members property in the same configuration as this property will generate an error.
- [System.Management.Automation.PSCredential] Credential (Write): A credential to resolve non-local group members.
None
- Create or modify a group with Members
- Create or modify a group with MembersToInclude and/or MembersToExclude
Provides a mechanism to configure and manage Windows services on a target node. This resource works on Nano Server.
None
- [String] Name (Key): Indicates the service name. Note that sometimes this is different from the display name. You can get a list of the services and their current state with the Get-Service cmdlet.
- [String] Ensure (Write): Indicates whether the service is present or absent. Defaults to Present. { Present | Absent }.
- [String] Path (Write): The path to the service executable file.
- [String] StartupType (Write): Indicates the startup type for the service. { Automatic | Disabled | Manual }.
- [String] BuiltInAccount (Write): Indicates the sign-in account to use for the service. { LocalService | LocalSystem | NetworkService }.
- [PSCredential] Credential (Write): The credential to run the service under.
- [Boolean] DesktopInteract (Write): Indicates whether the service can create or communicate with a window on the desktop. Must be false for services not running as LocalSystem. Defaults to False.
- [String] State (Write): Indicates the state you want to ensure for the service. Defaults to Running. { Running | Stopped | Ignore }.
- [String] DisplayName (Write): The display name of the service.
- [String] Description (Write): The description of the service.
- [String[]] Dependencies (Write): An array of strings indicating the names of the dependencies of the service.
- [Uint32] StartupTimeout (Write): The time to wait for the service to start in milliseconds. Defaults to 30000.
- [Uint32] TerminateTimeout (Write): The time to wait for the service to stop in milliseconds. Defaults to 30000.
None
Provides a mechanism to manage local users on a target node. This resource works on Nano Server.
None
- [String] UserName (Key): Indicates the account name for which you want to ensure a specific state.
- [String] Description (Write): Indicates the description you want to use for the user account.
- [Boolean] Disabled (Write): Indicates if the account is disabled. Set this property to true to ensure that this account is disabled, and set it to false to ensure that it is enabled. The default value is false.
- [String] Ensure (Write): Ensures that the feature is present or absent { Present | Absent }.
- [String] FullName (Write): Represents a string with the full name you want to use for the user account.
- [PSCredential] Password (Write): Indicates the password you want to use for this account.
- [Boolean] PasswordChangeNotAllowed (Write): Indicates if the user can change the password. Set this property to true to ensure that the user cannot change the password, and set it to false to allow the user to change the password. The default value is false.
- [Boolean] PasswordChangeRequired (Write): Indicates if the user must change the password at the next sign in. Set this property to true if the user must change their password. The default value is true.
- [Boolean] PasswordNeverExpires (Write): Indicates if the password will expire. To ensure that the password for this account will never expire, set this property to true. The default value is false.
None
Provides a mechanism to install or uninstall Windows roles or features on a target node. This resource is not supported on Nano Server.
- Target machine must be running Windows Server 2008 or later.
- Target machine must have access to the DISM PowerShell module.
- Target machine must have access to the ServerManager module (provided by default on Windows Server).
- [String] Name (Key): Indicates the name of the role or feature that you want to ensure is added or removed. This is the same as the Name property from the Get-WindowsFeature cmdlet, and not the display name of the role or feature.
- [PSCredential] Credential (Write): Indicates the credential to use to add or remove the role or feature if needed.
- [String] Ensure (Write): Specifies whether the feature should be installed (Present) or uninstalled (Absent) { Present | Absent }.
- [Boolean] IncludeAllSubFeature (Write): Specifies whether or not all subfeatures should be installed with the specified role or feature. The default value is false.
- [String] LogPath (Write): Indicates the path to a log file to log the operation.
- [String] DisplayName (Read): The display name of the retrieved role or feature.
Provides a mechanism to enable or disable optional features on a target node. This resource works on Nano Server.
- Target machine must be running a Windows client operating system, Windows Server 2012 or later, or Nano Server.
- Target machine must have access to the DISM PowerShell module
- [String] Name (Key): The name of the Windows optional feature to enable or disable.
- [String] Ensure (Write): Specifies whether the feature should be enabled or disabled. To enable the feature, set this property to Present. To disable the feature, set the property to Absent. The default value is Present. { Present | Absent }.
- [Boolean] RemoveFilesOnDisable (Write): Specifies that all files associated with the feature should be removed if the feature is being disabled.
- [Boolean] NoWindowsUpdateCheck (Write): Specifies whether or not DISM contacts Windows Update (WU) when searching for the source files to enable the feature. If $true, DISM will not contact WU.
- [String] LogPath (Write): The path to the log file to log this operation. There is no default value, but if not set, the log will appear at %WINDIR%\Logs\Dism\dism.log.
- [String] LogLevel (Write): The maximum output level to show in the log. ErrorsOnly will log only errors. ErrorsAndWarning will log only errors and warnings. ErrorsAndWarningAndInformation will log errors, warnings, and debug information). The default value is "ErrorsAndWarningAndInformation". { ErrorsOnly | ErrorsAndWarning | ErrorsAndWarningAndInformation }.
- [String[]] CustomProperties (Read): The custom properties retrieved from the Windows optional feature as an array of strings.
- [String] Description (Read): The description retrieved from the Windows optional feature.
- [String] DisplayName (Read): The display name retrieved from the Windows optional feature.
Provides a mechanism to install or uninstall a package from a windows cabinet (cab) file on a target node. This resource works on Nano Server.
- Target machine must have access to the DISM PowerShell module
- [String] Name (Key): The name of the package to install or uninstall.
- [String] Ensure (Required): Specifies whether the package should be installed or uninstalled. To install the package, set this property to Present. To uninstall the package, set the property to Absent. { Present | Absent }.
- [String] SourcePath (Required): The path to the cab file to install or uninstall the package from.
- [String] LogPath (Write): The path to a file to log the operation to. There is no default value, but if not set, the log will appear at %WINDIR%\Logs\Dism\dism.log.
None
- Added WindowsFeature
- Initial release of PSDscResources