Skip to content

fix: resolve duplicate -WhatIf parameter error in audit policy script - #4

Merged
0xPrashanthSec merged 2 commits into
mainfrom
docs/update-root-readme
Jun 12, 2026
Merged

fix: resolve duplicate -WhatIf parameter error in audit policy script#4
0xPrashanthSec merged 2 commits into
mainfrom
docs/update-root-readme

Conversation

@0xPrashanthSec

Copy link
Copy Markdown
Owner

Summary

  • Removes SupportsShouldProcess from [CmdletBinding()] in Get-AuditPolicyAnalysis.ps1
  • SupportsShouldProcess automatically injects -WhatIf as a common parameter, conflicting with the explicit [switch]$WhatIf already declared in param() — causing a ParameterNameAlreadyExistsForCommand error at runtime
  • Script uses -WhatIf directly (not via $PSCmdlet.ShouldProcess()), so SupportsShouldProcess was never needed

Test plan

  • Run .\Get-AuditPolicyAnalysis.ps1 — confirm no parameter error
  • Run .\Get-AuditPolicyAnalysis.ps1 -WhatIf — confirm analysis runs and fix script is skipped

🤖 Generated with Claude Code

…ter error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation Windows Changes to Windows scripts Linux Changes to Linux scripts Mac Changes to Mac scripts CI/CD Changes to GitHub Actions workflows labels Jun 12, 2026
@0xPrashanthSec 0xPrashanthSec removed documentation Improvements or additions to documentation Linux Changes to Linux scripts Mac Changes to Mac scripts labels Jun 12, 2026
@0xPrashanthSec
0xPrashanthSec merged commit 6e850a9 into main Jun 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Changes to GitHub Actions workflows Windows Changes to Windows scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant