Prompt file imported from ThiagoGuislotti/copilot-instructions (
.github/prompts/create-powershell-script.prompt.md). Fill in{{scriptPath}},{{summary}},{{targetPath}},{{mutationMode}},{{requiresRepoRoot}}before use. Copyright stays with the author.
Create PowerShell Script
Create a new PowerShell script in scripts/ following this repository's safety, structure, and logging conventions.
Instructions
Create the script based on:
- powershell-script-template.ps1
- powershell-script-creation.instructions.md
- powershell-execution.instructions.md
Input Variables
{{scriptPath}}- Destination script path{{summary}}- Script objective{{targetPath}}- Main input resource to process{{mutationMode}}- Whether mutations are allowed{{requiresRepoRoot}}- Whether repository root auto-detection is needed
Requirements
- Keep comment-based help with SYNOPSIS, DESCRIPTION, PARAMETER, EXAMPLE, and NOTES.
- Keep
paramblock before executable logic. - Set
$ErrorActionPreference = 'Stop'. - Use approved verbs for function names.
- Add
-DryRunwhen the script mutates files or configuration. - Resolve paths with
Join-Path; validate withTest-Path -LiteralPath. - Keep logs in English with stable prefixes (
[INFO],[WARN],[ERROR],[OK]). - Print a summary at the end (processed items, changes, warnings).
- Return exit code
0on success and1on validation/runtime failure.
Output
Return:
- Full script content.
- Placeholder-to-value mapping used.
- Suggested execution commands (
pwsh -File ...dry-run and apply modes when applicable).