Skip to content

Fix PSScriptAnalyzer findings and add remediation safety improvements - #1

Merged
0xPrashanthSec merged 2 commits into
mainfrom
feature/remediation-improvements
Jun 4, 2026
Merged

Fix PSScriptAnalyzer findings and add remediation safety improvements#1
0xPrashanthSec merged 2 commits into
mainfrom
feature/remediation-improvements

Conversation

@0xPrashanthSec

@0xPrashanthSec 0xPrashanthSec commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix 13 PSScriptAnalyzer findings across 5 Windows scripts:
    • Fixed missing ) in Log-Action string subexpression (08_Remediation.ps1:52) — one typo caused 9 cascading parse errors
    • Wrapped foreach-to-pipeline patterns in $(...) in 02, 03, 04, 05 scripts to resolve EmptyPipeElement warnings
  • Add warning banner + interactive menu to 08_Remediation.ps1:
    • Prominent warning listing all destructive actions shown on every run
    • Mandatory yes gate — script exits immediately if not confirmed
    • Numbered menu (1–10) when no parameters are passed, prompts for required input then runs the selected action

Test plan

  • Run .\08_Remediation.ps1 with no args — warning banner displays, menu appears after confirmation
  • Type no at the confirmation prompt — script exits with "No changes made"
  • Select option 0 from the menu — exits cleanly
  • Run with a parameter e.g. -KillPID 9999 — warning still shows, skips menu, runs action directly
  • Verify PSScriptAnalyzer workflow passes on this PR (GitHub Actions)

🤖 Generated with Claude Code

0xPrashanthSec and others added 2 commits June 4, 2026 19:36
- Fix missing closing parenthesis in Log-Action string subexpression
  (08_Remediation.ps1:52) — one typo caused 9 cascading parse errors
- Wrap foreach-pipe patterns in $(...) in 4 scripts to resolve
  EmptyPipeElement warnings (foreach keyword cannot feed a pipeline directly)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When run without parameters, the script now shows a warning about
destructive/irreversible actions and requires explicit confirmation
before proceeding, then presents a numbered menu to select and
configure a remediation action interactively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@0xPrashanthSec 0xPrashanthSec self-assigned this Jun 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message that will be displayed on users' first pull request

@0xPrashanthSec 0xPrashanthSec added the enhancement New feature or request label Jun 4, 2026
@0xPrashanthSec
0xPrashanthSec merged commit b1e14b6 into main Jun 4, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant