Fix TeamsTemplatesPolicy error handling to prevent false drift (Fixes…#6903
Fix TeamsTemplatesPolicy error handling to prevent false drift (Fixes…#6903Shiva210Jyoti wants to merge 3 commits intomicrosoft:Devfrom
Conversation
|
What if I want to create a policy that doesn't exist yet? With your diff it will throw an error and the resource won't be created. Did you actually tested this? |
|
The |
|
Correct, with that changed the rest of the diff is fine by me |
|
Agree with @ricmestre. It is important to handle the actual exception thrown by |
|
@Shiva210Jyoti can you update your PR accordingly? Thanks |
|
@microsoft-github-policy-service agree |
|
Thanks for the feedback everyone. Updated the implementation so that only the first Get-CsTeamsTemplatePermissionPolicy call is wrapped in targeted try/catch logic. It now returns Confirmed behavior: Other cmdlet calls retain Ready for re-review. |
|
@Shiva210Jyoti Please add an entry to the changelog. Thank you. |
Fixes #6899
Ensures TeamsTemplatesPolicy cmdlet failures are terminating by replacing SilentlyContinue and implicit non-terminating errors with -ErrorAction Stop for Get-CsTeamsTemplatePermissionPolicy and Get-CsTeamTemplateList.
This prevents partial state evaluation when Teams APIs return malformed responses, eliminating false-positive drift on HiddenTemplates.
Changes are minimal and localized to MSFT_TeamsTemplatesPolicy.psm1.