Skip to content

Commit

Permalink
Resolving PR Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NEllis280 committed Nov 29, 2021
1 parent a459eb2 commit e75c4be
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,15 @@ function Get-TargetResource
{
switch ($item.PropertyName)
{
'Certificate Store' { if ([string]::IsNullOrEmpty($item.Value1))
{
'Certificate Store' {
if ([string]::IsNullOrEmpty($item.Value1))
{
$customStore = 'Personal'
}
else
{
}
else
{
$customStore = $item.Value1
}
}
}

'Select First Certificate' { $certSel = @('FailSelectionAndSendErrorMessage','SelectCertificateWithLongestValidityPeriod')[($item.Value)] }
Expand Down Expand Up @@ -617,9 +618,11 @@ function Set-TargetResource

if ($state.SiteType -eq 'Primary')
{
$defaultValues += @('ClientCheckCertificateRevocationListForSiteSystem','UsePkiClientCertificate',
'RequireSigning','UseEncryption','EnableLowFreeSpaceAlert','EnableWakeOnLan','ClientCertificateCustomStoreName',
'TakeActionForMultipleCertificateMatchCriteria','ClientCertificateSelectionCriteriaType','ClientComputerCommunicationType')
$defaultValues += @(
'ClientCheckCertificateRevocationListForSiteSystem','UsePkiClientCertificate','RequireSigning','UseEncryption',
'EnableLowFreeSpaceAlert','EnableWakeOnLan','ClientCertificateCustomStoreName','TakeActionForMultipleCertificateMatchCriteria',
'ClientCertificateSelectionCriteriaType','ClientComputerCommunicationType'
)

if (($PSBoundParameters.ContainsKey('UseSmsGeneratedCert')) -and
(-not [string]::IsNullOrEmpty($ClientComputerCommunicationType) -and $ClientComputerCommunicationType -eq 'HttpsOnly') -or
Expand Down Expand Up @@ -664,9 +667,11 @@ function Set-TargetResource
}
}

$wolParams = @('WakeOnLanTransmissionMethodType','RetryNumberOfSendingWakeupPacketTransmission','SendingWakeupPacketTransmissionDelayMins',
'MaximumNumberOfSendingWakeupPacketBeforePausing','SendingWakeupPacketBeforePausingWaitSec','ThreadNumberOfSendingWakeupPacket',
'SendingWakeupPacketTransmissionOffsetMins')
$wolParams = @(
'WakeOnLanTransmissionMethodType','RetryNumberOfSendingWakeupPacketTransmission','SendingWakeupPacketTransmissionDelayMins',
'MaximumNumberOfSendingWakeupPacketBeforePausing','SendingWakeupPacketBeforePausingWaitSec','ThreadNumberOfSendingWakeupPacket',
'SendingWakeupPacketTransmissionOffsetMins'
)

foreach ($param in $wolParams)
{
Expand Down Expand Up @@ -1096,9 +1101,11 @@ function Test-TargetResource

if ($state.SiteType -eq 'Primary')
{
$defaultValues += @('ClientCheckCertificateRevocationListForSiteSystem','UsePkiClientCertificate',
'RequireSigning','UseEncryption','EnableLowFreeSpaceAlert','EnableWakeOnLan','ClientCertificateCustomStoreName',
'TakeActionForMultipleCertificateMatchCriteria','ClientCertificateSelectionCriteriaType','ClientComputerCommunicationType')
$defaultValues += @(
'ClientCheckCertificateRevocationListForSiteSystem','UsePkiClientCertificate','RequireSigning','UseEncryption',
'EnableLowFreeSpaceAlert','EnableWakeOnLan','ClientCertificateCustomStoreName','TakeActionForMultipleCertificateMatchCriteria',
'ClientCertificateSelectionCriteriaType','ClientComputerCommunicationType'
)

if (($PSBoundParameters.ContainsKey('UseSmsGeneratedCert')) -and
(-not [string]::IsNullOrEmpty($ClientComputerCommunicationType) -and $ClientComputerCommunicationType -eq 'HttpsOnly') -or
Expand Down Expand Up @@ -1145,9 +1152,11 @@ function Test-TargetResource
}
}

$wolParams = @('WakeOnLanTransmissionMethodType','RetryNumberOfSendingWakeupPacketTransmission','SendingWakeupPacketTransmissionDelayMins',
'MaximumNumberOfSendingWakeupPacketBeforePausing','SendingWakeupPacketBeforePausingWaitSec','ThreadNumberOfSendingWakeupPacket',
'SendingWakeupPacketTransmissionOffsetMins')
$wolParams = @(
'WakeOnLanTransmissionMethodType','RetryNumberOfSendingWakeupPacketTransmission','SendingWakeupPacketTransmissionDelayMins',
'MaximumNumberOfSendingWakeupPacketBeforePausing','SendingWakeupPacketBeforePausingWaitSec','ThreadNumberOfSendingWakeupPacket',
'SendingWakeupPacketTransmissionOffsetMins'
)

foreach ($param in $wolParams)
{
Expand Down
9 changes: 3 additions & 6 deletions tests/Unit/CMSiteConfiguration.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Invoke-TestSetup
try
{
InModuleScope $script:dscResourceName {
Describe 'ConfigMgrCBDsc - DSC_CMSiteConfiguration\Get-TargetResource' -Tag 'Get'{
Describe 'ConfigMgrCBDsc - DSC_CMSiteConfiguration\Get-TargetResource' -Tag 'Get' {
BeforeAll {
$getInput = @{
SiteCode = 'Lab'
Expand Down Expand Up @@ -451,7 +451,6 @@ try
Value = 1
}
)

}

$wolBroadcast = @{
Expand Down Expand Up @@ -482,7 +481,6 @@ try
Value = 2
}
)

}

$wolComponent = @{
Expand Down Expand Up @@ -920,7 +918,7 @@ try
}
}

Describe 'ConfigMgrCBDsc - DSC_CMSiteConfiguration\Set-TargetResource' -Tag 'Set'{
Describe 'ConfigMgrCBDsc - DSC_CMSiteConfiguration\Set-TargetResource' -Tag 'Set' {
BeforeAll {
$getReturnAll = @{
SiteCode = 'Lab'
Expand Down Expand Up @@ -1032,7 +1030,6 @@ try
SiteCode = 'Lab'
UseSmsGeneratedCert = $true
ClientComputerCommunicationType = 'HttpsOnly'

}

$inputWakeFalse = @{
Expand Down Expand Up @@ -1282,7 +1279,7 @@ try
}
}

Describe 'ConfigMgrCBDsc - DSC_CMSiteConfiguration\Test-TargetResource' -Tag 'Test'{
Describe 'ConfigMgrCBDsc - DSC_CMSiteConfiguration\Test-TargetResource' -Tag 'Test' {
BeforeAll {
$getReturnAll = @{
SiteCode = 'Lab'
Expand Down
8 changes: 8 additions & 0 deletions tests/Unit/ConfigMgrCBDsc.ReverseDsc.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6119,6 +6119,13 @@ InModuleScope $script:subModuleName {
}

$invokeSiteConfigurationPri = @{
ConfigurationName = $null
DependsOn = $null
ModuleName = 'ConfigMgrCBDsc'
ModuleVersion = 1.0.1
PsDscRunAsCredential = $null
ResourceId = $null
SourceInfo = $null
SiteCode = 'Lab'
Comment = 'Site Lab'
ClientComputerCommunicationType = 'HttpsOrHttp'
Expand Down Expand Up @@ -6151,6 +6158,7 @@ InModuleScope $script:subModuleName {
TakeActionForMultipleCertificateMatchCriteria = 'SelectCertificateWithLongestValidityPeriod'
ClientCertificateSelectionCriteriaType = 'ClientAuthentication'
ClientCertificateSelectionCriteriaValue = 'Personal'
PSComputerName = 'localhost'
}

$invokeSiteConfigurationCas = @{
Expand Down

0 comments on commit e75c4be

Please sign in to comment.