You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
Using a very "long" ProxyServerExceptions list will lead to an error while trying to apply the configuration. The reason is that the length of the ProxyServerExceptions string currently can't exceed 255 characters as it's converted to a byte.
Verbose logs showing the problem
I'm only including the relevant part.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Test-TargetResource: Checking the computer proxy settings to ensure 'Present'.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Test-TargetResource: Checking that the computer proxy settings 'DefaultConnectionSettings' are in the desired state.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Test-ProxySettings: The proxy setting 'ProxyServerExceptions' value 'b1.com;*.web2.com;*.web3.com;*.web4.com;*.' does not match the desired value '*.example1.com;*.example2.com;*.example3.
com;*.example4.com;*.example5.com;*.example6.com;*.example7.com;*.example8.com;*.example9.com;*.example10.com;*.example11.com;*.example12.com;*.example13.com;*.example14.com;*.example15.com;*.example16.com;*.example17.com'.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Test-TargetResource: Computer proxy settings 'DefaultConnectionSettings' are not in the desired state.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Test-TargetResource: Checking that the computer proxy settings 'SavedLegacySettings' are in the desired state.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Test-ProxySettings: The proxy setting 'ProxyServerExceptions' value 'b1.com;*.web2.com;*.web3.com;*.web4.com;*.' does not match the desired value '*.example1.com;*.example2.com;*.example3.
com;*.example4.com;*.example5.com;*.example6.com;*.example7.com;*.example8.com;*.example9.com;*.example10.com;*.example11.com;*.example12.com;*.example13.com;*.example14.com;*.example15.com;*.example16.com;*.example17.com'.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Test-TargetResource: Computer proxy settings 'SavedLegacySettings' are not in the desired state.
VERBOSE: [AD]: LCM: [ End Test ] [[ProxySettings]Longbypass] in 0.2190 seconds.
VERBOSE: [AD]: LCM: [ Start Set ] [[ProxySettings]Longbypass]
VERBOSE: [AD]: [[ProxySettings]Longbypass] Set-TargetResource: Applying the computer proxy settings to ensure 'Present'.
VERBOSE: [AD]: [[ProxySettings]Longbypass] Set-TargetResource: Enabling computer proxy settings.
Cannot convert value "262" to type "System.Byte". Error: "Value was either too large or too small for an unsigned byte."
+ CategoryInfo : InvalidArgument: (:) [], CimException
+ FullyQualifiedErrorId : InvalidCastIConvertible
+ PSComputerName : localhost
As far as I can tell those 4 bytes can be used to indicate the length but as it is little endian hex you need to convert it to hex and reverse the order for each pair. The following would only be a patch for the write, I didn't check the read but it likely needs to be adjusted as well.
There probably is a better solution to do the conversion.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Using a value of 17 generates a ProxyServerExceptions list that results in a string that's 262 character long. Using a value of 16 results in a string that's 246 characters long.
Great catch and thanks for raising this @Seth401 - looks like this one shouldn't be too tough to fix. Happy to take PRs from the community - but otherwise I'll try and get to it as soon as I can (got a few other repos I'm looking after).
Details of the scenario you tried and the problem that is occurring
Using a very "long" ProxyServerExceptions list will lead to an error while trying to apply the configuration. The reason is that the length of the ProxyServerExceptions string currently can't exceed 255 characters as it's converted to a byte.
Verbose logs showing the problem
I'm only including the relevant part.
Suggested solution to the issue
The responsible line within the ProxySettings DSC resource directly uses the string length. If this exceeds 255 it can't be converted to a byte.
https://github.com/PowerShell/NetworkingDsc/blob/e714098d02654dfa8a3aed6b44430c68cea9fdbf/Modules/NetworkingDsc/DSCResources/MSFT_ProxySettings/MSFT_ProxySettings.psm1#L655
As far as I can tell those 4 bytes can be used to indicate the length but as it is little endian hex you need to convert it to hex and reverse the order for each pair. The following would only be a patch for the write, I didn't check the read but it likely needs to be adjusted as well.
There probably is a better solution to do the conversion.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Using a value of 17 generates a ProxyServerExceptions list that results in a string that's 262 character long. Using a value of 16 results in a string that's 246 characters long.
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
6.3.0.0
The text was updated successfully, but these errors were encountered: