Port Style Upgrades from xPSDesiredStateConfiguration - Post Review #1

This commit is contained in:
Mike Hendrickson
2019-06-06 09:05:45 -07:00
parent 587bfe50a1
commit 4a7f80d3b9
5 changed files with 30 additions and 41 deletions
+5 -5
View File
@@ -37,25 +37,25 @@ Configuration GroupSet
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true, HelpMessage="The names of the groups for which you want to ensure a specific state.")]
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$GroupName,
[Parameter( HelpMessage="Indicates whether the groups exist. Set this property to Absent to ensure that the groups do not exist. Setting it to Present (the default value) ensures that the groups exist.")]
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
[Parameter( HelpMessage="Use this property to add members to the existing membership of the group. The value of this property is an array of strings of the form Domain\UserName. If you set this property in a configuration, do not use the Members property. Doing so will generate an error.")]
[Parameter()]
[System.String[]]
$MembersToInclude,
[Parameter( HelpMessage="Use this property to remove members from the existing membership of the groups. The value of this property is an array of strings of the form Domain\UserName. If you set this property in a configuration, do not use the Members property. Doing so will generate an error.")]
[Parameter()]
[System.String[]]
$MembersToExclude,
[Parameter( HelpMessage="The credentials required to access remote resources. Note: This account must have the appropriate Active Directory permissions to add all non-local accounts to the group; otherwise, an error will occur.")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -51,38 +51,38 @@ Configuration ProcessSet
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true, HelpMessage="The file paths to the executables of the processes to start or stop. Only the names of the files may be specified if they are all accessible through the environment path. Relative paths are not supported.")]
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$Path,
[Parameter(HelpMessage="Specifies whether or not the processes should exist. To start processes, set this property to Present. To stop processes, set this property to Absent.")]
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
[Parameter(HelpMessage="The credential of the user account to start the processes under.")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter(HelpMessage="The file path to write the standard output to. Any existing file at this path will be overwritten.This property cannot be specified at the same time as Credential when running the processes as a local user.")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.String]
$StandardOutputPath,
[Parameter(HelpMessage="The file path to write the standard error output to. Any existing file at this path will be overwritten.")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.String]
$StandardErrorPath,
[Parameter(HelpMessage="The file path to get standard input from. This property cannot be specified at the same time as Credential when running the processes as a local user.")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.String]
$StandardInputPath,
[Parameter(HelpMessage="The file path to use as the working directory for the processes. Any existing file at this path will be overwritten. This property cannot be specified at the same time as Credential when running the processes as a local user.")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.String]
$WorkingDirectory
@@ -51,32 +51,32 @@ Configuration ServiceSet
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true, HelpMessage="An array of the names of the services to configure.")]
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$Name,
[Parameter(HelpMessage="Specifies whether or not the set of services should exist. Set this property to Present to modify a set of services. Set this property to Absent to remove a set of services.")]
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
[Parameter(HelpMessage="The startup type each service in the set should have.")]
[Parameter()]
[ValidateSet('Automatic', 'Manual', 'Disabled')]
[System.String]
$StartupType,
[Parameter(HelpMessage="The built-in account each service in the set should start under. Cannot be specified at the same time as Credential. The user account specified by this property must have access to the service executable paths in order to start the services.")]
[Parameter()]
[ValidateSet('LocalSystem', 'LocalService', 'NetworkService')]
[System.String]
$BuiltInAccount,
[Parameter(HelpMessage="The state each service in the set should be in. From the default value defined in Service, the default will be Running.")]
[Parameter()]
[ValidateSet('Running', 'Stopped', 'Ignore')]
[System.String]
$State,
[Parameter(HelpMessage="he credential of the user account each service in the set should start under. Cannot be specified at the same time as BuiltInAccount. 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 paths in order to start the services.")]
[Parameter()]
[ValidateNotNull()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -41,40 +41,32 @@ Configuration WindowsFeatureSet
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true, HelpMessage="The name of the roles or features to install or uninstall.")]
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$Name,
[Parameter(HelpMessage="Specifies whether the roles or features should be installed or uninstalled.
To install the features, set this property to Present.
To uninstall the features, set this property to Absent.")]
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
[Parameter(HelpMessage="Specify the source")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.String]
$Source,
[Parameter(HelpMessage="Specifies whether or not all subfeatures should be installed or uninstalled alongside the specified roles or features.
If this property is true and Ensure is set to Present, all subfeatures will be installed.
If this property is false and Ensure is set to Present, subfeatures will not be installed or uninstalled.
If Ensure is set to Absent, all subfeatures will be uninstalled.")]
[Parameter()]
[System.Boolean]
$IncludeAllSubFeature,
[Parameter(HelpMessage="The credential of the user account under which to install or uninstall the roles or features.")]
[Parameter()]
[ValidateNotNull()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter(HelpMessage="The custom file path to which to log this operation.
If not passed in, the default log path will be used (%windir%\logs\ServerManager.log).")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.String]
$LogPath
@@ -41,33 +41,30 @@ Configuration WindowsOptionalFeatureSet
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true, HelpMessage="The names of the Windows optional features to enable or disable.")]
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$Name,
[Parameter(Mandatory = $true, HelpMessage="Specifies whether the features should be enabled or disabled.
To enable a set of features, set this property to Present.
To disable a set of features, set this property to Absent.")]
[Parameter(Mandatory = $true)]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
[Parameter(HelpMessage="Specifies whether or not to remove all files associated with the features when they are disabled.")]
[Parameter()]
[System.Boolean]
$RemoveFilesOnDisable,
[Parameter(HelpMessage="Specifies whether or not DISM should contact Windows Update (WU) when searching for the source files to restore Windows optional features on an online image.")]
[Parameter()]
[System.Boolean]
$NoWindowsUpdateCheck,
[Parameter(HelpMessage="The file path to which to log the opertation.")]
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.String]
$LogPath,
[Parameter(HelpMessage="The level of detail to include in the log.")]
[Parameter()]
[ValidateSet('ErrorsOnly', 'ErrorsAndWarning', 'ErrorsAndWarningAndInformation')]
[System.String]
$LogLevel