This pull request includes a significant change to the Format-PolicyDefinition function in the Scripts/Format-PolicyDefinition.ps1 file. The primary focus is on improving error handling and ensuring the JSON content is correctly parsed.
Key changes include:
Added a try-catch block to handle exceptions when converting JSON content, ensuring any errors are caught and their messages are thrown. (Scripts/Format-PolicyDefinition.ps1)
Restored the use of ConvertFrom-Json with -AsHashtable and -Depth 100 to handle the JSON conversion more robustly. (Scripts/Format-PolicyDefinition.ps1)table, we cannot remove keys one by one, causing the script to fail.
This pull request includes a significant change to the
Format-PolicyDefinition
function in theScripts/Format-PolicyDefinition.ps1
file. The primary focus is on improving error handling and ensuring the JSON content is correctly parsed.Key changes include:
Scripts/Format-PolicyDefinition.ps1
)ConvertFrom-Json
with-AsHashtable
and-Depth 100
to handle the JSON conversion more robustly. (Scripts/Format-PolicyDefinition.ps1
)table, we cannot remove keys one by one, causing the script to fail.