diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e12b1e..bbda55f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 to evaluate those two properties again. - Added unit tests for the function `Test-TargetResource`. - Reordered the resources in alphabetical order in the README.md. +- DhcpServerOptionValue + - Added -Force flag to all Set-DhcpServerV4OptionValue calls to resolve errors + when unnessesary validation is performed by the Cmdlet. + ([issue #56](https://github.com/dsccommunity/xDhcpServer/issues/56)) ### Removed diff --git a/azure-pipelines.yml b/azure-pipelines.yml index afc8a18..1c430b1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,7 +25,7 @@ stages: - job: Package_Module displayName: 'Package Module' pool: - vmImage: 'ubuntu-latest' + vmImage: 'windows-latest' steps: - pwsh: | dotnet tool install --global GitVersion.Tool diff --git a/source/Modules/DhcpServerDsc.OptionValueHelper/DhcpServerDsc.OptionValueHelper.psm1 b/source/Modules/DhcpServerDsc.OptionValueHelper/DhcpServerDsc.OptionValueHelper.psm1 index e0d3ed7..e267796 100644 --- a/source/Modules/DhcpServerDsc.OptionValueHelper/DhcpServerDsc.OptionValueHelper.psm1 +++ b/source/Modules/DhcpServerDsc.OptionValueHelper/DhcpServerDsc.OptionValueHelper.psm1 @@ -604,7 +604,7 @@ function Set-TargetResourceHelper { $serverSettingValueMessage = $script:localizedData.ServerSettingValueMessage -f $OptionId, $VendorClass, $UserClass Write-Verbose $serverSettingValueMessage - Set-DhcpServerv4OptionValue -OptionId $OptionId -Value $Value -VendorClass $VendorClass -UserClass $UserClass + Set-DhcpServerv4OptionValue -OptionId $OptionId -Value $Value -VendorClass $VendorClass -UserClass $UserClass -Force } # Ensure = 'Absent' @@ -637,7 +637,7 @@ function Set-TargetResourceHelper # If value should be present we just set it $scopeSettingValueMessage = $script:localizedData.ScopeSettingValueMessage -f $OptionId, $VendorClass, $UserClass, $ScopeId Write-Verbose $scopeSettingValueMessage - Set-DhcpServerv4OptionValue -ScopeId $ScopeId -OptionId $OptionId -Value $Value -VendorClass $VendorClass -UserClass $UserClass + Set-DhcpServerv4OptionValue -ScopeId $ScopeId -OptionId $OptionId -Value $Value -VendorClass $VendorClass -UserClass $UserClass -Force } # Ensure = 'Absent' @@ -674,7 +674,7 @@ function Set-TargetResourceHelper # If value should be present we just set it $policyWithScopeSettingValueMessage = $script:localizedData.PolicyWithScopeSettingValueMessage -f $OptionId, $VendorClass, $PolicyName, $ScopeId Write-Verbose $policyWithScopeSettingValueMessage - Set-DhcpServerv4OptionValue -PolicyName $PolicyName -OptionId $OptionId -ScopeId $ScopeId -Value $Value -VendorClass $VendorClass + Set-DhcpServerv4OptionValue -PolicyName $PolicyName -OptionId $OptionId -ScopeId $ScopeId -Value $Value -VendorClass $VendorClass -Force } # Ensure = 'Absent' @@ -706,7 +706,7 @@ function Set-TargetResourceHelper # If value should be present we just set it $policySettingValueMessage = $script:localizedData.PolicySettingValueMessage -f $OptionId, $VendorClass, $PolicyName Write-Verbose $policySettingValueMessage - Set-DhcpServerv4OptionValue -PolicyName $PolicyName -OptionId $OptionId -Value $Value -VendorClass $VendorClass + Set-DhcpServerv4OptionValue -PolicyName $PolicyName -OptionId $OptionId -Value $Value -VendorClass $VendorClass -Force } else { @@ -738,7 +738,7 @@ function Set-TargetResourceHelper # If value should be present we just set it $reservedIPSettingValueMessage = $script:localizedData.ReservedIPSettingValueMessage -f $OptionId, $VendorClass, $UserClass, $ReservedIP Write-Verbose $reservedIPSettingValueMessage - Set-DhcpServerv4OptionValue -ReservedIP $ReservedIP -OptionId $OptionId -Value $Value -VendorClass $VendorClass -UserClass $UserClass + Set-DhcpServerv4OptionValue -ReservedIP $ReservedIP -OptionId $OptionId -Value $Value -VendorClass $VendorClass -UserClass $UserClass -Force } # Ensure = 'Absent'