xpsdesiredstateconfiguration
Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
Start using this module
Add this module to your Puppetfile:
mod 'dsc-xpsdesiredstateconfiguration', '9.2.1-0-0'
Learn more about managing modules with a PuppetfileDocumentation
xpsdesiredstateconfiguration
Table of Contents
Description
This is an auto-generated module, using the Puppet DSC Builder to vendor and expose the xPSDesiredStateConfiguration PowerShell module's DSC resources as Puppet resources. The functionality of this module comes entirely from the vendored PowerShell resources, which are pinned at v9.2.1. The PowerShell module describes itself like this:
DSC resources for configuring common operating systems features, files and settings.
For information on troubleshooting to determine whether any encountered problems are with the Puppet wrapper or the DSC resource, see the troubleshooting section below.
Requirements
This module, like all auto-generated Puppetized DSC modules, relies on two important technologies in the Puppet stack: the Puppet Resource API and the puppetlabs/pwshlib Puppet module.
The Resource API provides a simplified option for writing types and providers and is responsible for how this module is structured. The Resource API ships inside of Puppet starting with version 6. While it is technically possible to add the Resource API functionality to Puppet 5.5.x, the DSC functionality has not been tested in this setup. For more information on the Resource API, review the documentation.
The module also depends on the pwshlib module. This Puppet module includes two important things: the ruby-pwsh library for running PowerShell code from ruby and the base provider for DSC resources, which this module leverages.
All of the actual work being done to call the DSC resources vendored with this module is in this file from the pwshlib module. This is important for troubleshooting and bug reporting, but doesn't impact your use of the module except that the end result will be that nothing works, as the dependency is not installed alongside this module!
Long File Path Support
Several PowerShell modules with DSC Resources end up with very long file paths once vendored, many of which exceed the 260 character limit for file paths. Luckily in Windows 10 (build 1607+), Windows Server 2016 (build 1607+), and Windows Server 2019 there is now an option for supporting long file paths transparently!
We strongly recommend enabling long file path support on any machines using this module to avoid path length issues.
You can set this value using the Puppet registry_value
resource:
registry_value { 'HKLM\System\CurrentControlSet\Control\FileSystem\LongPathsEnabled':
ensure => 'present',
data => [1],
provider => 'registry',
type => 'dword',
}
You can also set this value outside of Puppet by following the Microsoft documentation.
Usage
You can specify any of the DSC resources from this module like a normal Puppet resource in your manifests. The examples below use DSC resources from from the PowerShellGet repository, regardless of what module you're looking at here; the syntax, not the specifics, is what's important.
For reference documentation about the DSC resources exposed in this module, see the Reference Forge tab, or the REFERENCE.md file.
# Include a meaningful title for your resource declaration
dsc_psrepository { 'Add team module repo':
dsc_name => 'foo',
dsc_ensure => present,
# This location is nonsense, can be any valid folder on your
# machine or in a share, any location the SourceLocation param
# for the DSC resource will accept.
dsc_sourcelocation => 'C:\Program Files',
# You must always pass an enum fully lower-cased;
# Puppet is case sensitive even when PowerShell isn't
dsc_installationpolicy => untrusted,
}
dsc_psrepository { 'Trust public gallery':
dsc_name => 'PSGallery',
dsc_ensure => present,
dsc_installationpolicy => trusted,
}
dsc_psmodule { 'Make Ruby manageable via uru':
dsc_name => 'RubyInstaller',
dsc_ensure => present,
}
Credentials
Credentials are always specified as a hash of the username and password for the account. The password must use the Puppet Sensitive type; this ensures that logs and reports redact the password, displaying it instead as <Sensitive [value redacted]>.
dsc_psrepository { 'PowerShell Gallery':
dsc_name => 'psgAllery',
dsc_installationpolicy => 'Trusted',
dsc_psdscrunascredential => {
user => 'apple',
password => Sensitive('foobar'),
},
}
Class-Based Resources
Class-based DSC Resources can be used like any other DSC Resource in this module, with one important note:
Due to a bug in calling class-based DSC Resources by path instead of module name, each call to Invoke-DscResource
needs to temporarily munge the system-level environment variable for PSModulePath
;
the variable is reset prior to the end of each invocation.
CIM Instances
Because the CIM instances for DSC resources are fully mapped, the types actually explain fairly precisely what the shape of each CIM instance has to be - and, moreover, the type definition means that you get checking at catalog compile time. Puppet parses CIM instances are structured hashes (or arrays of structured hashes) that explicitly declare their keys and the valid types of values for each key.
So, for the dsc_accesscontrolentry
property of the dsc_ntfsaccessentry
type, which has a MOF type of NTFSAccessControlList[]
, Puppet defines the CIM instance as:
Array[Struct[{
accesscontrolentry => Array[Struct[{
accesscontroltype => Enum['Allow', 'Deny'],
inheritance => Enum['This folder only', 'This folder subfolders and files', 'This folder and subfolders', 'This folder and files', 'Subfolders and files only', 'Subfolders only', 'Files only'],
ensure => Enum['Present', 'Absent'],
cim_instance_type => 'NTFSAccessControlEntry',
filesystemrights => Array[Enum['AppendData', 'ChangePermissions', 'CreateDirectories', 'CreateFiles', 'Delete', 'DeleteSubdirectoriesAndFiles', 'ExecuteFile', 'FullControl', 'ListDirectory', 'Modify', 'Read', 'ReadAndExecute', 'ReadAttributes', 'ReadData', 'ReadExtendedAttributes', 'ReadPermissions', 'Synchronize', 'TakeOwnership', 'Traverse', 'Write', 'WriteAttributes', 'WriteData', 'WriteExtendedAttributes']]
}]],
forceprincipal => Optional[Boolean],
principal => Optional[String],
}]]
A valid example of that in a puppet manifest looks like this:
dsc_accesscontrollist => [
{
accesscontrolentry => [
{
accesscontroltype => 'Allow',
inheritance => 'This folder only',
ensure => 'Present',
filesystemrights => 'ChangePermissions',
cim_instance_type => 'NTFSAccessControlEntry',
},
],
principal => 'veryRealUserName',
},
]
For more information about using a built module, check out our narrative documentation.
Properties
Note that the only properties specified in a resource declaration which are passed to Invoke-Dsc are all prepended with dsc.
If a property does _not start with dsc_ it is used to control how Puppet interacts with DSC/other Puppet resources - for example,
specifying a unique name for the resource for Puppet to distinguish between declarations or Puppet metaparameters (notifies,
before, etc).
Validation Mode
By default, these resources use the property validation mode, which checks whether or not the resource is in the desired state the same way most Puppet resources are validated;
by comparing the properties returned from the system with those specified in the manifest.
Sometimes, however, this is insufficient;
many DSC Resources return data that does not compare properly to the desired state (some are missing properties, others are malformed, some simply cannot be strictly compared).
In these cases, you can set the validation mode to resource
, which falls back on calling Invoke-DscResource
with the Test
method and trusts that result.
When using the resource
validation mode, the resource is tested once and will then treat all properties of that resource as in sync (if the result returned true
) or not in sync.
This loses the granularity of change reporting for the resource but prevents flapping and unexpected behavior.
# This will flap because the DSC resource never returns name in SecurityPolicyDsc v2.10.0.0
dsc_securityoption { 'Enforce Anonoymous SID Translation':
dsc_name => 'Enforce Anonymous SID Translation',
dsc_network_access_allow_anonymous_sid_name_translation => 'Disabled',
}
# This will idempotently apply
dsc_psrepository { 'PowerShell Gallery':
validation_mode => 'resource',
dsc_name => 'Enforce Anonymous SID Translation',
dsc_network_access_allow_anonymous_sid_name_translation => 'Disabled',
}
It is important to note that this feature is only supported with a version of puppetlabs-pwshlib
equal to or higher than 0.9.0
, in which the supporting code for the DSC Base Provider to implement custom insync was shipped.
Finally, while this module's metadata says that the supported Puppet versions are 6.0.0 and up, the implementation of the validation_mode
parameter relies on the custom_insync
feature of the Puppet Resource API.
The custom_insync
feature first shipped in the puppet-resource_api
version 1.8.14
, which itself is only included in Puppet versions equal to or newer than 6.23.0
and 7.8.0
for the 6x and 7x platforms respectively.
Using this module against older Puppet versions will result in a warning (example below) and only use the default property-by-property change reporting, regardless of the setting of validation_mode
.
Warning: Unknown feature detected: ["custom_insync"]
Troubleshooting
In general, there are three broad categories of problems:
- Problems with the way the underlying DSC resource works.
- Problems with the type definition, where you can't specify a valid set of properties for the DSC resource
- Problems with calling the underlying DSC resource - the parameters aren't being passed correctly or the resource can't be found
Unfortunately, problems with the way the underlying DSC resource works are something we can't help directly with. You'll need to file an issue with the upstream maintainers for the PowerShell module.
Problems with the type definition are when a value that should be valid according to the DSC resource's documentation and code is not accepted by the Puppet wrapper. If and when you run across one of these, please file an issue with the Puppet DSC Builder; this is where the conversion happens and once we know of a problem we can fix it and regenerate the Puppet modules. To help us identify the issue, please specify the DSC module, version, resource, property and values that are giving you issues. Once a fix is available we will regenerate and release updated versions of this Puppet wrapper.
Problems with calling the underlying DSC resource become apparent by comparing <value passed in in puppet>
with <value received by DSC>
.
In this case, please file an issue with the puppetlabs/pwshlib module, which is where the DSC base provider actually lives.
We'll investigate and prioritize a fix and update the puppetlabs/pwshlib module.
Updating to the pwshlib version with the fix will immediately take advantage of the improved functionality without waiting for this module to be reconverted and published.
For specific information on troubleshooting a generated module, check the troubleshooting guide for the puppet.dsc module.
Known Limitations
-
Currently, because of the way Puppet caches files on agents, use of the legacy
puppetlabs-dsc
module is not compatible with this or any auto-generated DSC module. Inclusion of both will lead to pluginsync conflicts. -
Right now, if you have the same version of a PowerShell module with class-based DSC Resources in your PSModulePath as vendored in a Puppetized DSC Module, you cannot use those class-based DSC Resources from inside of Puppet due to a bug in DSC which prevents using a module by path reference instead of name. Instead, DSC will see that there are two DSC Resources for the same module and version and then error out.
-
When PowerShell Script Block Logging is enabled, data marked as sensitive in your manifest may appear in these logs as plain text. It is highly recommended, by both Puppet and Microsoft, that you also enable Protected Event Logging alongside this to encrypt the logs to protect this information.
Configuring the LCM
In order for a Puppetized DSC module to function, the DSC Local Configuration Manager (LCM) RefreshMode
must be set to either Push
or Disabled
.
The default value for RefreshMode
in WMF 5.0 and WMF 5.1 is Push
- so if it has not been set to anything else then there is no action needed on your part.
However if the value of the LCM has been set to anything other than Push
then the module will not function and so the value must either be changed back or disabled.
The Puppetized DSC modules use the Invoke-DscResource
cmdlet to invoke DSC Resources of the target machine.
If the RefreshMode
is set to Pull
, DSC Resources will only run from a DSC Pull Server - in this setting DSC does not allow any DSC Resources to be run interactively on the host.
Module Installation
If you're using this module with Puppet Enterprise and Code Manager, everything should "just work" - no errors or issues acquiring and deploying this or any Puppetized DSC module to nodes.
Unfortunately, due a bug in minitar which prevents it from unpacking archives with long file paths, both r10k
and serverless Puppet (via puppet module install
) methods of installing modules with long path names will fail.
In short, minitar is unable to unpack modules that contain long file paths (though it can create them).
As a workaround, you can retrieve DSC modules from the forge via PowerShell and 7zip:
$ModuleAuthor = 'dsc'
$ModuleName = 'xremotedesktopsessionhost'
$ModuleVersion = '2.0.0-0-1'
$ArchiveFileName = "$ModuleAuthor-$ModuleName-$ModuleVersion.tar.gz"
$DownloadUri = "https://forge.puppet.com/v3/files/$ArchiveFileName"
# Download the module tar.gz to the current directory
Invoke-WebRequest -Uri $DownloadUri -OutFile ./$ArchiveFileName
# Use 7zip to extract the module to the current directory
& 7z x $ArchiveFileName -so | & 7z x -aoa -si -ttar
Reference
Table of Contents
Resource types
dsc_xarchive
: The DSC xArchive resource type. Automatically generated from version 9.2.1dsc_xdscwebservice
: The DSC xDSCWebService resource type. Automatically generated from version 9.2.1dsc_xenvironment
: The DSC xEnvironment resource type. Automatically generated from version 9.2.1dsc_xfileupload
: The DSC resource type. Automatically generated from version 9.2.1dsc_xgroup
: The DSC xGroup resource type. Automatically generated from version 9.2.1dsc_xgroupset
: The DSC resource type. Automatically generated from version 9.2.1dsc_xmsipackage
: The DSC xMsiPackage resource type. Automatically generated from version 9.2.1dsc_xpackage
: The DSC xPackage resource type. Automatically generated from version 9.2.1dsc_xprocessset
: The DSC resource type. Automatically generated from version 9.2.1dsc_xpsendpoint
: The DSC xPSEndpoint resource type. Automatically generated from version 9.2.1dsc_xregistry
: The DSC xRegistry resource type. Automatically generated from version 9.2.1dsc_xremotefile
: The DSC xRemoteFile resource type. Automatically generated from version 9.2.1dsc_xscript
: The DSC xScript resource type. Automatically generated from version 9.2.1dsc_xservice
: The DSC xService resource type. Automatically generated from version 9.2.1dsc_xserviceset
: The DSC resource type. Automatically generated from version 9.2.1dsc_xuser
: The DSC xUser resource type. Automatically generated from version 9.2.1dsc_xwindowsfeature
: The DSC xWindowsFeature resource type. Automatically generated from version 9.2.1dsc_xwindowsfeatureset
: The DSC resource type. Automatically generated from version 9.2.1dsc_xwindowsoptionalfeature
: The DSC xWindowsOptionalFeature resource type. Automatically generated from version 9.2.1dsc_xwindowsoptionalfeatureset
: The DSC resource type. Automatically generated from version 9.2.1dsc_xwindowspackagecab
: The DSC xWindowsPackageCab resource type. Automatically generated from version 9.2.1dsc_xwindowsprocess
: The DSC xWindowsProcess resource type. Automatically generated from version 9.2.1
Resource types
dsc_xarchive
The DSC xArchive resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xarchive
type.
dsc_checksum
Data type: Optional[Enum['SHA-1', 'sha-1', 'SHA-256', 'sha-256', 'SHA-512', 'sha-512', 'CreatedDate', 'createddate', 'ModifiedDate', 'modifieddate']]
The Checksum method to use to validate whether or not a file at the destination with the same name as a file in the archive actually matches that corresponding file in the archive. An invalid argument exception will be thrown if Checksum is specified while Validate is specified as false. ModifiedDate will check that the LastWriteTime property of the file at the destination matches the LastWriteTime property of the file in the archive. CreatedDate will check that the CreationTime property of the file at the destination matches the CreationTime property of the file in the archive. SHA-1, SHA-256, and SHA-512 will check that the hash of the file at the destination by the specified SHA method matches the hash of the file in the archive by the specified SHA method. The default value is ModifiedDate.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Specifies whether or not the expanded content of the archive file at the specified path should exist at the specified destination. To update the specified destination to have the expanded content of the archive file at the specified path, specify this property as Present. To remove the expanded content of the archive file at the specified path from the specified destination, specify this property as Absent. The default value is Present.
Parameters
The following parameters are available in the dsc_xarchive
type.
dsc_credential
dsc_destination
dsc_force
dsc_path
dsc_psdscrunascredential
dsc_timeout
dsc_validate
name
validation_mode
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credential of a user account with permissions to access the specified archive path and destination if needed.
dsc_destination
namevar
Data type: String
The path where the specified archive file should be expanded to or removed from.
dsc_force
Data type: Optional[Boolean]
Specifies whether or not any existing files or directories at the destination with the same name as a file or directory in the archive should be overwritten to match the file or directory in the archive. When this property is false, an error will be thrown if an item at the destination needs to be overwritten. The default value is false.
dsc_path
namevar
Data type: String
The path to the archive file that should be expanded to or removed from the specified destination.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
dsc_validate
Data type: Optional[Boolean]
Specifies whether or not to validate that a file at the destination with the same name as a file in the archive actually matches that corresponding file in the archive by the specified checksum method. If the file does not match and Ensure is specified as Present and Force is not specified, the resource will throw an error that the file at the destination cannot be overwritten. If the file does not match and Ensure is specified as Present and Force is specified, the file at the destination will be overwritten. If the file does not match and Ensure is specified as Absent, the file at the destination will not be removed. The default value is false.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xdscwebservice
The DSC xDSCWebService resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xdscwebservice
type.
dsc_acceptselfsignedcertificates
Data type: Optional[Boolean]
Specifies is self-signed certs will be accepted for client authentication.
dsc_applicationpoolname
Data type: Optional[String]
The IIS Application Pool to use for the Pull Server. If not specified a pool with name 'PSWS' will be created.
dsc_certificatesubject
Data type: Optional[String]
The subject of the Certificate in CERT:\LocalMachine\MY\ for Pull Server.
dsc_certificatetemplatename
Data type: Optional[String]
The certificate Template Name of the Certificate in CERT:\LocalMachine\MY\ for Pull Server.
dsc_certificatethumbprint
Data type: Optional[String]
The thumbprint of the Certificate in CERT:\LocalMachine\MY\ for Pull Server.
dsc_configurationpath
Data type: Optional[String]
The location on the disk where the Configuration is stored.
dsc_configurefirewall
Data type: Optional[Boolean]
Enable incoming firewall exceptions for the configured DSC Pull Server port. Defaults to true.
dsc_databasepath
Data type: Optional[String]
The location on the disk where the database is stored.
dsc_disablesecuritybestpractices
Data type: Optional[Array[Enum['SecureTLSProtocols', 'securetlsprotocols']]]
A list of exceptions to the security best practices to apply.
dsc_dscserverurl
Data type: Optional[String]
The URL of the DSC Pull Server.
dsc_enable32bitapponwin64
Data type: Optional[Boolean]
Enable the DSC Pull Server to run in a 32-bit process on a 64-bit operating system.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Specifies if the DSC Web Service should be installed.
dsc_modulepath
Data type: Optional[String]
The location on the disk where the Modules are stored.
dsc_physicalpath
Data type: Optional[String]
The physical path for the IIS Endpoint on the machine (usually under inetpub).
dsc_port
Data type: Optional[Integer[0, 4294967295]]
The port number of the DSC Pull Server IIS Endpoint.
dsc_registrationkeypath
Data type: Optional[String]
The location on the disk where the RegistrationKeys file is stored.
dsc_sqlconnectionstring
Data type: Optional[String]
The connection string to use to connect to the SQL server backend database. Required if SqlProvider is true.
dsc_sqlprovider
Data type: Optional[Boolean]
Enable DSC Pull Server to use SQL server as the backend database.
dsc_state
Data type: Optional[Enum['Started', 'started', 'Stopped', 'stopped']]
Specifies the state of the DSC Web Service.
dsc_usesecuritybestpractices
Data type: Boolean
This property will ensure that the Pull Server is created with the most secure practices.
Parameters
The following parameters are available in the dsc_xdscwebservice
type.
dsc_endpointname
namevar
Data type: String
Prefix of the WCF SVC file.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xenvironment
The DSC xEnvironment resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xenvironment
type.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Specifies if the environment variable should exist.
dsc_path
Data type: Optional[Boolean]
Indicates whether or not the environment variable is a path variable. If the variable being configured is a path variable, the value provided will be appended to or removed from the existing value, otherwise the existing value will be replaced by the new value. When configured as a Path variable, multiple entries separated by semicolons are ensured to be either present or absent without affecting other Path entries.
dsc_target
Data type: Optional[Array[Enum['Process', 'process', 'Machine', 'machine']]]
Indicates the target where the environment variable should be set.
dsc_value
Data type: Optional[String]
The desired value for the environment variable. The default value is an empty string which either indicates that the variable should be removed entirely or that the value does not matter when testing its existence. Multiple entries can be entered and separated by semicolons.
Parameters
The following parameters are available in the dsc_xenvironment
type.
dsc_name
namevar
Data type: String
The name of the environment variable for which you want to ensure a specific state.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xfileupload
The DSC resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xfileupload
type.
dsc_certificatethumbprint
Data type: Optional[String]
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Parameters
The following parameters are available in the dsc_xfileupload
type.
dsc_destinationpath
namevar
Data type: String
dsc_sourcepath
namevar
Data type: String
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xgroup
The DSC xGroup resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xgroup
type.
dsc_description
Data type: Optional[String]
The description the group should have.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Indicates if the group should exist or not.
dsc_members
Data type: Optional[Array[String]]
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, UPN ,distinguished name or username (for local machine accounts). Using either the MembersToExclude or MembersToInclude properties in the same configuration as this property will generate an error.
dsc_memberstoexclude
Data type: Optional[Array[String]]
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, UPN ,distinguished name or username (for local machine accounts). Using the Members property in the same configuration as this property will generate an error.
dsc_memberstoinclude
Data type: Optional[Array[String]]
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, UPN ,distinguished name or username (for local machine accounts). Using the Members property in the same configuration as this property will generate an error.
Parameters
The following parameters are available in the dsc_xgroup
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
A credential to resolve non-local group members.
dsc_groupname
namevar
Data type: String
The name of the group to create, modify, or remove.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xgroupset
The DSC resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xgroupset
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_ensure
Data type: Optional[String]
dsc_memberstoexclude
Data type: Optional[Array[String]]
dsc_memberstoinclude
Data type: Optional[Array[String]]
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Parameters
The following parameters are available in the dsc_xgroupset
type.
dsc_groupname
namevar
Data type: Array[String]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xmsipackage
The DSC xMsiPackage resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xmsipackage
type.
dsc_arguments
Data type: Optional[String]
The arguments to be passed to the MSI package during installation or uninstallation.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Specifies whether or not the MSI file should be installed or uninstalled.
dsc_filehash
Data type: Optional[String]
The expected hash value of the MSI file at the given path.
dsc_hashalgorithm
Data type: Optional[Enum['SHA1', 'sha1', 'SHA256', 'sha256', 'SHA384', 'sha384', 'SHA512', 'sha512', 'MD5', 'md5', 'RIPEMD160', 'ripemd160']]
The algorithm used to generate the given hash value.
dsc_ignorereboot
Data type: Optional[Boolean]
Ignore a pending reboot if requested by package installation.
dsc_installedon
Data type: Optional[String]
The date that the MSI package was installed on or serviced on, whichever is later.
dsc_installsource
Data type: Optional[String]
The path to the MSI package.
dsc_logpath
Data type: Optional[String]
The path to the log file to log the output from the MSI execution.
dsc_name
Data type: Optional[String]
The display name of the MSI package.
dsc_packagedescription
Data type: Optional[String]
The description of the MSI package.
dsc_path
Data type: String
The path to the MSI file that should be installed or uninstalled.
dsc_publisher
Data type: Optional[String]
The publisher of the MSI package.
dsc_servercertificatevalidationcallback
Data type: Optional[String]
PowerShell code that should be used to validate SSL certificates for paths using HTTPS.
dsc_signersubject
Data type: Optional[String]
The subject that should match the signer certificate of the digital signature of the MSI file.
dsc_signerthumbprint
Data type: Optional[String]
The certificate thumbprint that should match the signer certificate of the digital signature of the MSI file.
dsc_size
Data type: Optional[Integer[0, 4294967295]]
The size of the MSI package in MB.
dsc_version
Data type: Optional[String]
The version number of the MSI package.
Parameters
The following parameters are available in the dsc_xmsipackage
type.
dsc_credential
dsc_productid
dsc_psdscrunascredential
dsc_runascredential
dsc_timeout
name
validation_mode
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credential of a user account to be used to mount a UNC path if needed.
dsc_productid
namevar
Data type: String
The identifying number used to find the package, usually a GUID.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_runascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credential of a user account under which to run the installation or uninstallation of the MSI package.
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xpackage
The DSC xPackage resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xpackage
type.
dsc_arguments
Data type: Optional[String]
The arguments to be passed to the package during addition or removal. When installing MSI packages, the '/quiet' and '/norestart' arguments are automatically applied.
dsc_createcheckregvalue
Data type: Optional[Boolean]
Specifies if a registry value should be created when the packages is installed.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Indicates whether to Ensure that the package is 'Present' or 'Absent'. Defaults to 'Present'.
dsc_filehash
Data type: Optional[String]
The expected hash value of the file found in the Path location.
dsc_hashalgorithm
Data type: Optional[Enum['SHA1', 'sha1', 'SHA256', 'sha256', 'SHA384', 'sha384', 'SHA512', 'sha512', 'MD5', 'md5', 'RIPEMD160', 'ripemd160']]
The algorithm used to generate the FileHash value. Defaults to 'SHA256'.
dsc_ignorereboot
Data type: Optional[Boolean]
Ignore a pending reboot if requested by package installation. The default value is $false and DSC will try to reboot the system.
dsc_installed
Data type: Optional[Boolean]
Whether the identified package is installed.
dsc_installedcheckreghive
Data type: Optional[Enum['LocalMachine', 'localmachine', 'CurrentUser', 'currentuser']]
The hive in which to create the registry key. Defaults to 'LocalMachine'.
dsc_installedcheckregkey
Data type: Optional[String]
The registry key to validate the package is installed.
dsc_installedcheckregvaluedata
Data type: Optional[String]
The registry value to validate the package is installed.
dsc_installedcheckregvaluename
Data type: Optional[String]
The registry value name to validate the package is installed.
dsc_installedon
Data type: Optional[String]
The date that the identified package was last serviced or its install date, whichever is later.
dsc_logpath
Data type: Optional[String]
The path to log the output of the MSI or EXE.
dsc_packagedescription
Data type: Optional[String]
The description of the identified package.
dsc_path
Data type: String
The path, URL or UNC path to the package.
dsc_publisher
Data type: Optional[String]
The publisher for the identified package.
dsc_returncode
Data type: Optional[Array[Integer[0, 4294967295]]]
The list of possible valid return codes for this install or removal.
dsc_servercertificatevalidationcallback
Data type: Optional[String]
PowerShell code used to validate SSL certificates of HTTPS url assigned to Path.
dsc_signersubject
Data type: Optional[String]
The subject that must match the signer certificate of the digital signature. Wildcards are allowed.
dsc_signerthumbprint
Data type: Optional[String]
The certificate thumbprint which must match the signer certificate of the digital signature.
dsc_size
Data type: Optional[Integer[0, 4294967295]]
The size of the identified package.
dsc_version
Data type: Optional[String]
The version number of the identified package.
Parameters
The following parameters are available in the dsc_xpackage
type.
dsc_credential
dsc_name
dsc_productid
dsc_psdscrunascredential
dsc_runascredential
dsc_timeout
name
validation_mode
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credentials to be used for mounting the UNC path (if applicable).
dsc_name
namevar
Data type: String
The name of the package to be added or removed.
dsc_productid
namevar
Data type: String
The identifying number used to uniquely identify this package.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_runascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credentials under which to run the installation.
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xprocessset
The DSC resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xprocessset
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_ensure
Data type: Optional[String]
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_standarderrorpath
Data type: Optional[String]
dsc_standardinputpath
Data type: Optional[String]
dsc_standardoutputpath
Data type: Optional[String]
dsc_workingdirectory
Data type: Optional[String]
Parameters
The following parameters are available in the dsc_xprocessset
type.
dsc_path
namevar
Data type: Array[String]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xpsendpoint
The DSC xPSEndpoint resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xpsendpoint
type.
dsc_accessmode
Data type: Optional[Enum['Local', 'local', 'Remote', 'remote', 'Disabled', 'disabled']]
Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The default value is 'Remote'.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Indicates if the session configuration should exist. The default value is 'Present'.
dsc_securitydescriptorsddl
Data type: Optional[String]
Specifies the Security Descriptor Definition Language (SDDL) string for the configuration. This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute(Invoke) permission for the configuration.
dsc_startupscript
Data type: Optional[String]
Specifies the startup script for the configuration. Enter the fully qualified path of a Windows PowerShell script.
Parameters
The following parameters are available in the dsc_xpsendpoint
type.
dsc_name
namevar
Data type: String
Specifies the name of the session configuration.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_runascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the credential for commands of this session configuration. By default, commands run with the permissions of the current user.
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xregistry
The DSC xRegistry resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xregistry
type.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Specifies whether or not the registry key or value should exist. To add or modify a registry key or value, set this property to Present. To remove a registry key or value, set the property to Absent.
dsc_hex
Data type: Optional[Boolean]
Specifies whether or not the specified DWord or QWord registry key data is provided in a hexadecimal format. Not valid for types other than DWord and QWord. The default value is $false.
dsc_valuedata
Data type: Optional[Array[String]]
The data the specified registry key value should have as a string or an array of strings (MultiString only).
dsc_valuetype
Data type: Optional[Enum['String', 'string', 'Binary', 'binary', 'DWord', 'dword', 'QWord', 'qword', 'MultiString', 'multistring', 'ExpandString', 'expandstring']]
The type the specified registry key value should have.
Parameters
The following parameters are available in the dsc_xregistry
type.
dsc_force
Data type: Optional[Boolean]
Specifies whether or not to overwrite the specified registry key value if it already has a value or whether or not to delete a registry key that has subkeys. The default value is $false.
dsc_key
namevar
Data type: String
The path of the registry key to add, modify, or remove. This path must include the registry hive/drive.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
dsc_valuename
namevar
Data type: String
The name of the registry value. To add or remove a registry key, specify this property as an empty string without specifying ValueType or ValueData. To modify or remove the default value of a registry key, specify this property as an empty string while also specifying ValueType or ValueData.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xremotefile
The DSC xRemoteFile resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xremotefile
type.
dsc_checksum
Data type: Optional[String]
Specifies the expected checksum value of downloaded file.
dsc_checksumtype
Data type: Optional[Enum['None', 'none', 'SHA1', 'sha1', 'SHA256', 'sha256', 'SHA384', 'sha384', 'SHA512', 'sha512', 'MACTripleDES', 'mactripledes', 'MD5', 'md5', 'RIPEMD160', 'ripemd160']]
Specifies the algorithm used to calculate the checksum of the file.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Returns whether the destination path exists on the machine.
dsc_headers
Data type: Optional[Array[Struct[{ key => Optional[String], value => Optional[String], }]]]
Headers of the web request.
dsc_matchsource
Data type: Optional[Boolean]
Determines whether the remote file should be re-downloaded if file in the DestinationPath was modified locally. The default value is true.
dsc_proxy
Data type: Optional[String]
Uses a proxy server for the request, rather than connecting directly to the Internet resource. Should be the URI of a network proxy server (e.g 'http://10.20.30.1').
dsc_timeoutsec
Data type: Optional[Integer[0, 4294967295]]
Specifies how long the request can be pending before it times out.
dsc_uri
Data type: String
URI of the file which should be downloaded. It must be a HTTP, HTTPS or FILE resource.
dsc_useragent
Data type: Optional[String]
User agent for the web request.
Parameters
The following parameters are available in the dsc_xremotefile
type.
dsc_credential
dsc_destinationpath
dsc_proxycredential
dsc_psdscrunascredential
dsc_timeout
name
validation_mode
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies credential of a user which has permissions to send the request.
dsc_destinationpath
namevar
Data type: String
Path under which downloaded or copied file should be accessible after operation.
dsc_proxycredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xscript
The DSC xScript resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xscript
type.
dsc_result
Data type: Optional[String]
The result from the GetScript script block.
Parameters
The following parameters are available in the dsc_xscript
type.
dsc_credential
dsc_getscript
dsc_psdscrunascredential
dsc_setscript
dsc_testscript
dsc_timeout
name
validation_mode
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credential of the user account to run the script under if needed.
dsc_getscript
namevar
Data type: String
A string that can be used to create a PowerShell script block that retrieves the current state of the resource. This script block runs when the Get-DscConfiguration cmdlet is called. This script block should return a hash table containing one key named Result with a string value.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_setscript
namevar
Data type: String
A string that can be used to create a PowerShell script block that sets the resource to the desired state. This script block runs conditionally when the Start-DscConfiguration cmdlet is called. The TestScript script block will run first. If the TestScript block returns False, this script block will run. If the TestScript block returns True, this script block will not run. This script block should not return.
dsc_testscript
namevar
Data type: String
A string that can be used to create a PowerShell script block that validates whether or not the resource is in the desired state. This script block runs when the Start-DscConfiguration cmdlet is called or when the Test-DscConfiguration cmdlet is called. This script block should return a boolean with True meaning that the resource is in the desired state and False meaning that the resource is not in the desired state.
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xservice
The DSC xService resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xservice
type.
dsc_builtinaccount
Data type: Optional[Enum['LocalSystem', 'localsystem', 'LocalService', 'localservice', 'NetworkService', 'networkservice']]
The built-in account the service should start under. Cannot be specified at the same time as Credential or GroupManagedServiceAccount. The user account specified by this property must have access to the service executable path defined by Path in order to start the service.
dsc_dependencies
Data type: Optional[Array[String]]
An array of strings indicating the names of the dependencies of the service.
dsc_description
Data type: Optional[String]
The description of the service.
dsc_desktopinteract
Data type: Optional[Boolean]
Indicates whether or not the service should be able to communicate with a window on the desktop. Must be false for services not running as LocalSystem. The default value is False.
dsc_displayname
Data type: Optional[String]
The display name of the service.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Ensures that the service is present or absent. Defaults to Present.
dsc_groupmanagedserviceaccount
Data type: Optional[String]
The Group Managed Service Account the service should start under. Cannot be specified at the same time as Credential or BuiltinAccount. The user account specified by this property must have access to the service executable path defined by Path in order to start the service. When specified in a DOMAIN\User$ form, remember to also input the trailing dollar sign.
dsc_path
Data type: Optional[String]
The path to the service executable file. Required when creating a service. The user account specified by BuiltInAccount or Credential must have access to this path in order to start the service.
dsc_startuptimeout
Data type: Optional[Integer[0, 4294967295]]
The time to wait for the service to start in milliseconds. Defaults to 30000 (30 seconds).
dsc_startuptype
Data type: Optional[Enum['Automatic', 'automatic', 'Manual', 'manual', 'Disabled', 'disabled']]
Indicates the startup type for the service. If StartupType is 'Disabled' and Service is not installed the resource will complete as being DSC compliant.
dsc_state
Data type: Optional[Enum['Running', 'running', 'Stopped', 'stopped', 'Ignore', 'ignore']]
Indicates the state you want to ensure for the service. Defaults to 'Running'.
dsc_terminatetimeout
Data type: Optional[Integer[0, 4294967295]]
The time to wait for the service to stop in milliseconds. Defaults to 30000 (30 seconds).
Parameters
The following parameters are available in the dsc_xservice
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credential of the user account the service should start under. Cannot be specified at the same time as BuiltInAccount or GroupManagedServiceAccount. The user specified by this credential will automatically be granted the Log on as a Service right. The user account specified by this property must have access to the service executable path defined by Path in order to start the service.
dsc_name
namevar
Data type: String
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.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xserviceset
The DSC resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xserviceset
type.
dsc_builtinaccount
Data type: Optional[String]
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_ensure
Data type: Optional[String]
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_startuptype
Data type: Optional[String]
dsc_state
Data type: Optional[String]
Parameters
The following parameters are available in the dsc_xserviceset
type.
dsc_name
namevar
Data type: Array[String]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xuser
The DSC xUser resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xuser
type.
dsc_description
Data type: Optional[String]
Indicates the description you want to use for the user account.
dsc_disabled
Data type: Optional[Boolean]
Indicates if the account is enabled. Set this property to $true to ensure that this account is disabled, and set it to $false to ensure that it is enabled. Defaults to $false.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Specified if the user account is present or absent.
dsc_fullname
Data type: Optional[String]
The full name of the user account.
dsc_passwordchangenotallowed
Data type: Optional[Boolean]
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.
dsc_passwordchangerequired
Data type: Optional[Boolean]
Indicates if the user must change the password at the next sign in. Set this property to $true if the user must change the password.
dsc_passwordneverexpires
Data type: Optional[Boolean]
Indicates if the password will expire. To ensure that the password for this account will never expire, set this property to $true, and set it to $false if the password will expire.
Parameters
The following parameters are available in the dsc_xuser
type.
dsc_password
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Indicates the password you want to use for this account.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
dsc_username
namevar
Data type: String
Indicates the account name for which you want to ensure a specific state.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xwindowsfeature
The DSC xWindowsFeature resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xwindowsfeature
type.
dsc_displayname
Data type: Optional[String]
The display name of the retrieved role or feature.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Specifies whether the feature should be installed (Present) or uninstalled (Absent). Defaults to 'Present'.
dsc_includeallsubfeature
Data type: Optional[Boolean]
Set this property to $true to ensure the state of all required subfeatures with the state of the feature you specify with the Name property. The default value is $false.
dsc_logpath
Data type: Optional[String]
Indicates the path to a log file to log the operation. If not specified, the default log path will be used (%WINDIR%\logs\ServerManager.log).
Parameters
The following parameters are available in the dsc_xwindowsfeature
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Indicates the credential to use to add or remove the role or feature if needed.
dsc_name
namevar
Data type: String
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.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xwindowsfeatureset
The DSC resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xwindowsfeatureset
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_ensure
Data type: Optional[String]
dsc_includeallsubfeature
Data type: Optional[Boolean]
dsc_logpath
Data type: Optional[String]
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_source
Data type: Optional[String]
Parameters
The following parameters are available in the dsc_xwindowsfeatureset
type.
dsc_name
namevar
Data type: Array[String]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xwindowsoptionalfeature
The DSC xWindowsOptionalFeature resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xwindowsoptionalfeature
type.
dsc_customproperties
Data type: Optional[Array[String]]
The custom properties retrieved from the Windows optional feature as an array of strings.
dsc_description
Data type: Optional[String]
The description retrieved from the Windows optional feature.
dsc_displayname
Data type: Optional[String]
The display name retrieved from the Windows optional feature.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
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.
dsc_loglevel
Data type: Optional[Enum['ErrorsOnly', 'errorsonly', 'ErrorsAndWarning', 'errorsandwarning', 'ErrorsAndWarningAndInformation', 'errorsandwarningandinformation']]
The maximum output level to show in the log. Accepted values are: ErrorsOnly (only errors are logged), ErrorsAndWarning (errors and warnings are logged), and ErrorsAndWarningAndInformation (errors, warnings, and debug information are logged).
dsc_logpath
Data type: Optional[String]
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.
dsc_nowindowsupdatecheck
Data type: Optional[Boolean]
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.
dsc_removefilesondisable
Data type: Optional[Boolean]
Specifies that all files associated with the feature should be removed if the feature is being disabled.
Parameters
The following parameters are available in the dsc_xwindowsoptionalfeature
type.
dsc_name
namevar
Data type: String
The name of the Windows optional feature to enable or disable.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xwindowsoptionalfeatureset
The DSC resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xwindowsoptionalfeatureset
type.
dsc_loglevel
Data type: Optional[String]
dsc_logpath
Data type: Optional[String]
dsc_nowindowsupdatecheck
Data type: Optional[Boolean]
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_removefilesondisable
Data type: Optional[Boolean]
Parameters
The following parameters are available in the dsc_xwindowsoptionalfeatureset
type.
dsc_ensure
namevar
Data type: String
dsc_name
namevar
Data type: Array[String]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xwindowspackagecab
The DSC xWindowsPackageCab resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xwindowspackagecab
type.
dsc_ensure
Data type: Enum['Present', 'present', 'Absent', 'absent']
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.
dsc_logpath
Data type: Optional[String]
The path to a file to log the operation to.
dsc_sourcepath
Data type: String
The path to the cab file to install or uninstall the package from.
Parameters
The following parameters are available in the dsc_xwindowspackagecab
type.
dsc_name
namevar
Data type: String
The name of the package to install or uninstall.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xwindowsprocess
The DSC xWindowsProcess resource type. Automatically generated from version 9.2.1
Properties
The following properties are available in the dsc_xwindowsprocess
type.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
Indicates whether the process is present (running) or absent (not running).
dsc_handlecount
Data type: Optional[Integer[-2147483648, 2147483647]]
The number of handles opened by the process.
dsc_nonpagedmemorysize
Data type: Optional[Integer[0, 18446744073709551615]]
The amount of nonpaged memory, in bytes, allocated for the process.
dsc_pagedmemorysize
Data type: Optional[Integer[0, 18446744073709551615]]
The amount of paged memory, in bytes, allocated for the process.
dsc_processcount
Data type: Optional[Integer[-2147483648, 2147483647]]
The number of instances of the given process that are currently running.
dsc_processid
Data type: Optional[Integer[-2147483648, 2147483647]]
The unique identifier of the process.
dsc_standarderrorpath
Data type: Optional[String]
The path to write the standard error stream to.
dsc_standardinputpath
Data type: Optional[String]
The path to receive standard input from.
dsc_standardoutputpath
Data type: Optional[String]
The path to write the standard output stream to.
dsc_virtualmemorysize
Data type: Optional[Integer[0, 18446744073709551615]]
The amount of virtual memory, in bytes, allocated for the process.
dsc_workingdirectory
Data type: Optional[String]
The directory to run the processes under.
Parameters
The following parameters are available in the dsc_xwindowsprocess
type.
dsc_arguments
namevar
Data type: String
A string of arguments to pass to the process executable. Pass in an empty string if no arguments are needed.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credential to run the process under.
dsc_path
namevar
Data type: String
The full path or file name to the process executable to start or stop.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
[9.2.1] - 2024-11-11
Fixed
- xGroup
- Fixed a bug where the get resource would fail if group members is empty Issue #772
Dependencies
- puppetlabs/pwshlib (>= 1.2.0 < 2.0.0)