Skip to content

Commit

Permalink
Fix review comments at r1
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Apr 21, 2018
1 parent 8af38ea commit b531397
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions DSCResources/MSFT_xADComputer/MSFT_xADComputer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function Test-TargetResource
}
else
{
## Add ensure and enabled as they may not be explicitly passed and we want to enumerate them
# Add ensure as it may not be explicitly passed and we want to enumerate it.
$PSBoundParameters['Ensure'] = $Ensure;

foreach ($parameter in $PSBoundParameters.Keys)
Expand Down Expand Up @@ -531,7 +531,7 @@ function Set-TargetResource
$setADComputerParams contains more than one value (ignoring parameter
'Identity' by itself).
#>
if ($replaceComputerProperties.Count -or $removeComputerProperties.Count -or $setADComputerParams.Count -gt 1)
if ($replaceComputerProperties.Count -gt 0 -or $removeComputerProperties.Count -gt 0 -or $setADComputerParams.Count -gt 1)
{
## Only pass -Remove and/or -Replace if we have something to set/change
if ($replaceComputerProperties.Count -gt 0)
Expand Down Expand Up @@ -576,7 +576,7 @@ function Set-DscADComputer
{
param
(
[Parameter()]
[Parameter(Mandatory = $true)]
[System.Collections.Hashtable]
$SetADComputerParameters
)
Expand Down
2 changes: 1 addition & 1 deletion DSCResources/MSFT_xADComputer/MSFT_xADComputer.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MSFT_xADComputer : OMI_BaseResource
[Write, Description("Specifies the user account credentials to use to perform the task"), EmbeddedInstance("MSFT_Credential")] String DomainAdministratorCredential;
[Write, Description("Specifies the full path to the Offline Domain Join Request file to create.")] String RequestFile;
[Write, ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] String Ensure;
[Write, Description("Specifies if the the computer account should be created disabled ($true) or enabled ($false). Default a computer account will be created as enabled. If the parameter Enabled is used in the same configuration that will override this parameter.")] Boolean CreateDisabled;
[Write, Description("Specifies if the the computer account should be created disabled ($true) or enabled ($false). By default a computer account will be created as enabled. If the parameter Enabled is used in the same configuration then that will override this parameter.")] Boolean CreateDisabled;
[Read, Description("Returns the X.500 path of the computer object")] String DistinguishedName;
[Read, Description("Returns the security identifier of the computer object")] String SID;
};
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ The xADComputer DSC resource will manage computer accounts within Active Directo
* **DistinguishedName**: Returns the X.500 path of the computer object (read-only).
* **SID**: Returns the security identifier of the computer object (read-only).
* **CreateDisabled*: Specifies if the the computer account should be created disabled ($true)
or enabled ($false). Default a computer account will be created as enabled. If
or enabled ($false). By default a computer account will be created as enabled. If
the parameter Enabled is used in the same configuration then that will override this
parameter.

Expand All @@ -302,13 +302,13 @@ Setting an ODJ Request file path for a configuration that creates a computer acc
* Added xADServicePrincipalName resource.
* Changes to xADComputer
* BREAKING CHANGE: Previously a computer account was always set to enabled
regardless of `Enabled` parameter was used in a configuration. Now if
regardless if the `Enabled` parameter was used in a configuration. Now if
the `Enabled` parameter is left out of the configuration, the
computer account will not be evaluated if it enabled. So if a computer is
disabled, the resource will not enabled it unless `Enabled` parameter is
computer account will not be evaluated if it is enabled. So if a computer is
disabled, the resource will not enable it unless the `Enabled` parameter is
set to `$true` in the configuration.
* A computer account can now be created disabled by setting the parameter
`CreateDisabled` to `$true`. Default a computer account will be created
`CreateDisabled` to `$true`. By default a computer account will be created
as enabled.

### 2.16.0.0
Expand Down
14 changes: 7 additions & 7 deletions Tests/Unit/MSFT_xADComputer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ try
}

Context 'When not specifying the parameter Enabled' {
It 'Should create a computer account that are enabled' {
It 'Should create a computer account that is enabled' {
$setTargetResourceParameters = $testPresentParams.Clone()

Set-TargetResource @setTargetResourceParameters
Expand All @@ -688,7 +688,7 @@ try
}

Context 'When specifying the parameter Enabled with the value $true' {
It 'Should create a computer account that are enabled' {
It 'Should create a computer account that is enabled' {
$setTargetResourceParameters = $testPresentParams.Clone()
$setTargetResourceParameters['Enabled'] = $true

Expand All @@ -705,7 +705,7 @@ try
}

Context 'When specifying the parameter CreateDisabled with the value $false and parameter Enabled with value $true' {
It 'Should create a computer account that are enabled' {
It 'Should create a computer account that is enabled' {
$setTargetResourceParameters = $testPresentParams.Clone()
$setTargetResourceParameters['CreateDisabled'] = $false
$setTargetResourceParameters['Enabled'] = $true
Expand Down Expand Up @@ -757,7 +757,7 @@ try
}

Context 'When specifying the parameter Enabled with the value $false' {
It 'Should create a computer account that are disabled' {
It 'Should create a computer account that is disabled' {
$setTargetResourceParameters = $testPresentParams.Clone()
$setTargetResourceParameters['Enabled'] = $false

Expand All @@ -774,7 +774,7 @@ try
}

Context 'When specifying the parameter CreateDisabled with the value $true' {
It 'Should create a computer account that are disabled' {
It 'Should create a computer account that is disabled' {
$setTargetResourceParameters = $testPresentParams.Clone()
$setTargetResourceParameters['CreateDisabled'] = $true

Expand All @@ -791,7 +791,7 @@ try
}

Context 'When specifying the parameter CreateDisabled with the value $false and Enabled with value $false' {
It 'Should create a computer account that are disabled' {
It 'Should create a computer account that is disabled' {
$setTargetResourceParameters = $testPresentParams.Clone()
$setTargetResourceParameters['CreateDisabled'] = $false
$setTargetResourceParameters['Enabled'] = $false
Expand All @@ -809,7 +809,7 @@ try
}

Context 'When specifying the parameter CreateDisabled with the value $true and Enabled with value $false' {
It 'Should create a computer account that are disabled' {
It 'Should create a computer account that is disabled' {
$setTargetResourceParameters = $testPresentParams.Clone()
$setTargetResourceParameters['CreateDisabled'] = $true
$setTargetResourceParameters['Enabled'] = $false
Expand Down

0 comments on commit b531397

Please sign in to comment.