Is your feature request related to a problem? Please describe.
I spent 45 minutes trying to troubleshoot why my global settings were failing in v10. It took me that long to realize that there was a message being written to host explaining what element was failing
Describe the solution you'd like
In the /Scripts/Helpers/Get-GlobalSettings.ps1 script, rather than writing the context-aware error message to host and passing a boolean $hasErrors value, store the message in a variable and write it to the error stream.
Example:
$deleteOrphaned = $desired.deleteOrphanedExemptions
if ($null -ne $deleteOrphaned) {
$ErrorMessage = "Error in global-settings.jsonc: pacEnvironment $pacSelector field desiredState.deleteOrphanedExemptions is deprecated. Remove it!"
$hasErrors = $true
}
...
if ($hasErrors) {
Write-Error $ErrorMessage -ErrorAction Stop
}
Is your feature request related to a problem? Please describe. I spent 45 minutes trying to troubleshoot why my global settings were failing in v10. It took me that long to realize that there was a message being written to host explaining what element was failing
Describe the solution you'd like In the
/Scripts/Helpers/Get-GlobalSettings.ps1
script, rather than writing the context-aware error message to host and passing a boolean$hasErrors
value, store the message in a variable and write it to the error stream.Example: