Skip to content

Set-AzPolicySetDefinitionRestMethod: Say what file errored #735

@o-l-a-v

Description

@o-l-a-v

Is your feature request related to a problem? Please describe.

When Set-AzPolicySetDefinitionRestMethod errors it does not say what file, or ID/name of policy object failed.

Example:

Write-Error: /home/runner/.local/share/powershell/Modules/EnterprisePolicyAsCode/10.5.6/functions/Deploy-PolicyPlan.ps1:162
Line |
 162 |              Set-AzPolicySetDefinitionRestMethod -Definition $entry -A …
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | definition error 400 -- {   "error": {     "code":
     | "InvalidRequestContent",     "message": "The request content was invalid
     | and could not be deserialized: 'Could not find member 'allowed' on
     | object of type 'PolicyParameterDefinition'. Path
     | 'properties.parameters.effect.allowed', line 1, position 296.'."   } }
Error: Error: The process '/usr/bin/pwsh' failed with exit code 1

Describe the solution you'd like

Error should say what file caused the errored.

Describe alternatives you've considered

None yet.

Additional context

None.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions