PowerShell Master CRITICAL GUIDELINES Windows File Path Requirements MANDATORY: Always Use Backslashes on Windows for File Paths When using Edit or Write tools on Windows, you MUST use backslashes ( ) in file paths, NOT forward slashes ( ). Examples: - WRONG: - CORRECT: This applies to: - Edit tool file path parameter - Write tool file path parameter - All file operations on Windows systems Documentation Guidelines NEVER create new documentation files unless explicitly requested by the user. - Priority : Update existing README.md files rather than creating new documentation - Repository clean…

)]\n [string]$PhoneNumber\n )\n}\n```\n\n## Code Signing (Production)\n\n```powershell\n# Get code signing certificate\n$cert = Get-ChildItem Cert:\\CurrentUser\\My -CodeSigningCert\n\n# Sign script\nSet-AuthenticodeSignature -FilePath script.ps1 -Certificate $cert\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4178,"content_sha256":"821ed32c44fb372d364500cd7e3a0e900a0372cfddb7da1648a7ded98673c843"},{"filename":"references/syntax-reference.md","content":"# PowerShell Syntax and Cmdlets Reference\n\nDetailed reference for PowerShell language constructs, common cmdlets, REST patterns, testing, and performance tips.\n\n## Cmdlet Structure\n\n```powershell\n# Verb-Noun pattern\nGet-ChildItem\nSet-Location\nNew-Item\nRemove-Item\n\n# Common parameters (available on all cmdlets)\nGet-Process -Verbose\nSet-Content -Path file.txt -WhatIf\nRemove-Item -Path folder -Confirm\nInvoke-RestMethod -Uri $url -ErrorAction Stop\n```\n\n## Variables & Data Types\n\n```powershell\n# Variables (loosely typed)\n$string = \"Hello World\"\n$number = 42\n$array = @(1, 2, 3, 4, 5)\n$hashtable = @{Name=\"John\"; Age=30}\n\n# Strongly typed\n[string]$name = \"John\"\n[int]$age = 30\n[datetime]$date = Get-Date\n\n# Special variables\n$PSScriptRoot # Directory containing the script\n$PSCommandPath # Full path to the script\n$args # Script arguments\n$_ # Current pipeline object\n```\n\n## Operators\n\n```powershell\n# Comparison operators\n-eq # Equal\n-ne # Not equal\n-gt # Greater than\n-lt # Less than\n-match # Regex match\n-like # Wildcard match\n-contains # Array contains\n\n# Logical operators\n-and\n-or\n-not\n\n# PowerShell 7+ ternary operator\n$result = $condition ? \"true\" : \"false\"\n\n# Null-coalescing (PS 7+)\n$value = $null ?? \"default\"\n```\n\n## Control Flow\n\n```powershell\n# If-ElseIf-Else\nif ($condition) {\n # Code\n} elseif ($otherCondition) {\n # Code\n} else {\n # Code\n}\n\n# Switch\nswitch ($value) {\n 1 { \"One\" }\n 2 { \"Two\" }\n {$_ -gt 10} { \"Greater than 10\" }\n default { \"Other\" }\n}\n\n# Loops\nforeach ($item in $collection) {\n # Process item\n}\n\nfor ($i = 0; $i -lt 10; $i++) {\n # Loop code\n}\n\nwhile ($condition) {\n # Loop code\n}\n\ndo {\n # Loop code\n} while ($condition)\n```\n\n## Functions\n\n```powershell\nfunction Get-Something {\n [CmdletBinding()]\n param(\n [Parameter(Mandatory=$true)]\n [string]$Name,\n\n [Parameter()]\n [int]$Count = 1,\n\n [Parameter(ValueFromPipeline=$true)]\n [string[]]$InputObject\n )\n\n begin {\n # Initialization\n }\n\n process {\n # Process each pipeline object\n foreach ($item in $InputObject) {\n # Work with $item\n }\n }\n\n end {\n # Cleanup\n return $result\n }\n}\n```\n\n## Pipeline & Filtering\n\n```powershell\n# Pipeline basics\nGet-Process | Where-Object {$_.CPU -gt 100} | Select-Object Name, CPU\n\n# Simplified syntax (PS 3.0+)\nGet-Process | Where CPU -gt 100 | Select Name, CPU\n\n# ForEach-Object\nGet-ChildItem | ForEach-Object {\n Write-Host $_.Name\n}\n\n# Simplified (PS 4.0+)\nGet-ChildItem | % Name\n\n# Group, Sort, Measure\nGet-Process | Group-Object ProcessName\nGet-Service | Sort-Object Status\nGet-ChildItem | Measure-Object -Property Length -Sum\n```\n\n## Error Handling\n\n```powershell\n# Try-Catch-Finally\ntry {\n Get-Content -Path \"nonexistent.txt\" -ErrorAction Stop\n}\ncatch [System.IO.FileNotFoundException] {\n Write-Error \"File not found\"\n}\ncatch {\n Write-Error \"An error occurred: $_\"\n}\nfinally {\n # Cleanup code\n}\n\n# Error action preference\n$ErrorActionPreference = \"Stop\" # Treat all errors as terminating\n$ErrorActionPreference = \"Continue\" # Default\n$ErrorActionPreference = \"SilentlyContinue\" # Suppress errors\n```\n\n## Performance Optimization\n\n### PowerShell 7+ Features\n\n```powershell\n# Parallel ForEach (PS 7+)\n1..10 | ForEach-Object -Parallel {\n Start-Sleep -Seconds 1\n \"Processed $_\"\n} -ThrottleLimit 5\n\n# Ternary operator\n$result = $value ? \"true\" : \"false\"\n\n# Null-coalescing\n$name = $userName ?? \"default\"\n\n# Null-conditional member access\n$length = $string?.Length\n```\n\n### Efficient Filtering\n\n```powershell\n# Use .NET methods for performance\n# Instead of: Get-Content large.txt | Where-Object {$_ -match \"pattern\"}\n[System.IO.File]::ReadLines(\"large.txt\") | Where-Object {$_ -match \"pattern\"}\n\n# Use -Filter parameter when available\nGet-ChildItem -Path C:\\ -Filter *.log -Recurse\n# Instead of: Get-ChildItem -Path C:\\ -Recurse | Where-Object {$_.Extension -eq \".log\"}\n```\n\n### ArrayList vs Array\n\n```powershell\n# Arrays are immutable - slow for additions\n$array = @()\n1..1000 | ForEach-Object { $array += $_ } # SLOW\n\n# Use ArrayList for dynamic collections\n$list = [System.Collections.ArrayList]::new()\n1..1000 | ForEach-Object { [void]$list.Add($_) } # FAST\n\n# Or use generic List\n$list = [System.Collections.Generic.List[int]]::new()\n1..1000 | ForEach-Object { $list.Add($_) }\n```\n\n### Common Pitfall: Array Concatenation Performance\n\n```powershell\n# Bad: $array += $item (recreates array each time)\n\n# Good: Use ArrayList or List\n$list = [System.Collections.Generic.List[object]]::new()\n$list.Add($item)\n```\n\n## Testing with Pester\n\n```powershell\n# Install Pester\nInstall-Module -Name Pester -Force\n\n# Basic test structure\nDescribe \"Get-Something Tests\" {\n Context \"When input is valid\" {\n It \"Should return expected value\" {\n $result = Get-Something -Name \"Test\"\n $result | Should -Be \"Expected\"\n }\n }\n\n Context \"When input is invalid\" {\n It \"Should throw an error\" {\n { Get-Something -Name $null } | Should -Throw\n }\n }\n}\n\n# Run tests\nInvoke-Pester -Path ./tests\nInvoke-Pester -Path ./tests -OutputFormat NUnitXml -OutputFile TestResults.xml\n\n# Code coverage\nInvoke-Pester -Path ./tests -CodeCoverage ./src/*.ps1\n```\n\n## Script Requirements & Versioning\n\n```powershell\n# Require specific PowerShell version\n#Requires -Version 7.0\n\n# Require modules\n#Requires -Modules Az.Accounts, Az.Compute\n\n# Require admin/elevated privileges (Windows)\n#Requires -RunAsAdministrator\n\n# Combine multiple requirements\n#Requires -Version 7.0\n#Requires -Modules @{ModuleName='Pester'; ModuleVersion='5.0.0'}\n\n# Use strict mode\nSet-StrictMode -Version Latest\n```\n\n## Common Cmdlets Reference\n\n### File System\n\n```powershell\nGet-ChildItem (gci, ls, dir)\nSet-Location (cd, sl)\nNew-Item (ni)\nRemove-Item (rm, del)\nCopy-Item (cp, copy)\nMove-Item (mv, move)\nRename-Item (rn, ren)\nGet-Content (gc, cat, type)\nSet-Content (sc)\nAdd-Content (ac)\n```\n\n### Process Management\n\n```powershell\nGet-Process (ps, gps)\nStop-Process (kill, spps)\nStart-Process (start, saps)\nWait-Process\n```\n\n### Service Management\n\n```powershell\nGet-Service (gsv)\nStart-Service (sasv)\nStop-Service (spsv)\nRestart-Service (srsv)\nSet-Service\n```\n\n### Network\n\n```powershell\nTest-Connection (ping)\nTest-NetConnection\nInvoke-WebRequest (curl, wget, iwr)\nInvoke-RestMethod (irm)\n```\n\n### Object Manipulation\n\n```powershell\nSelect-Object (select)\nWhere-Object (where, ?)\nForEach-Object (foreach, %)\nSort-Object (sort)\nGroup-Object (group)\nMeasure-Object (measure)\nCompare-Object (compare, diff)\n```\n\n## REST API & Web Requests\n\n```powershell\n# GET request\n$response = Invoke-RestMethod -Uri \"https://api.example.com/data\" -Method Get\n\n# POST with JSON body\n$body = @{\n name = \"John\"\n age = 30\n} | ConvertTo-Json\n\n$response = Invoke-RestMethod -Uri \"https://api.example.com/users\" `\n -Method Post -Body $body -ContentType \"application/json\"\n\n# With headers and authentication\n$headers = @{\n \"Authorization\" = \"Bearer $token\"\n \"Accept\" = \"application/json\"\n}\n\n$response = Invoke-RestMethod -Uri $url -Headers $headers\n\n# Download file\nInvoke-WebRequest -Uri $url -OutFile \"file.zip\"\n```\n\n## Script Structure Best Practices\n\n```powershell\n\u003c#\n.SYNOPSIS\n Brief description\n\n.DESCRIPTION\n Detailed description\n\n.PARAMETER Name\n Parameter description\n\n.EXAMPLE\n PS> .\\script.ps1 -Name \"John\"\n Example usage\n\n.NOTES\n Author: Your Name\n Version: 1.0.0\n Date: 2025-01-01\n#>\n\n[CmdletBinding()]\nparam(\n [Parameter(Mandatory=$true)]\n [string]$Name\n)\n\n# Script-level error handling\n$ErrorActionPreference = \"Stop\"\n\n# Use strict mode\nSet-StrictMode -Version Latest\n\ntry {\n # Main script logic\n Write-Verbose \"Starting script\"\n\n # ... script code ...\n\n Write-Verbose \"Script completed successfully\"\n}\ncatch {\n Write-Error \"Script failed: $_\"\n exit 1\n}\nfinally {\n # Cleanup\n}\n```\n\n## Common Pitfalls\n\n### Out-GridView Search Broken in 7.5\n\n```powershell\n# Known Issue: Out-GridView search doesn't work in PowerShell 7.5 due to .NET 9 changes\n# Workaround: Use Where-Object or Select-Object for filtering\nGet-Process | Where-Object CPU -gt 100 | Format-Table\n\n# Or export to CSV and use external tools\nGet-Process | Export-Csv processes.csv -NoTypeInformation\n```\n\n### Execution Policy\n\n```powershell\n# Solution: Set for current user\nSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n\n# Or bypass for session\npowershell.exe -ExecutionPolicy Bypass -File script.ps1\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":8635,"content_sha256":"0a1633991a2b34c8e5bfedc1688e82342352b4a97f22eef0a519485f4936f3b7"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"PowerShell Master","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"CRITICAL GUIDELINES","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Windows File Path Requirements","type":"text"}]},{"type":"paragraph","content":[{"text":"MANDATORY: Always Use Backslashes on Windows for File Paths","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"When using Edit or Write tools on Windows, you MUST use backslashes (","type":"text"},{"text":"\\","type":"text","marks":[{"type":"code_inline"}]},{"text":") in file paths, NOT forward slashes (","type":"text"},{"text":"/","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]},{"type":"paragraph","content":[{"text":"Examples:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"WRONG: ","type":"text"},{"text":"D:/repos/project/file.tsx","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CORRECT: ","type":"text"},{"text":"D:\\repos\\project\\file.tsx","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"This applies to:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Edit tool file_path parameter","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Write tool file_path parameter","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"All file operations on Windows systems","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Documentation Guidelines","type":"text"}]},{"type":"paragraph","content":[{"text":"NEVER create new documentation files unless explicitly requested by the user.","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Priority","type":"text","marks":[{"type":"strong"}]},{"text":": Update existing README.md files rather than creating new documentation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Repository cleanliness","type":"text","marks":[{"type":"strong"}]},{"text":": Keep repository root clean - only README.md unless user requests otherwise","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Style","type":"text","marks":[{"type":"strong"}]},{"text":": Documentation should be concise, direct, and professional - avoid AI-generated tone","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"User preference","type":"text","marks":[{"type":"strong"}]},{"text":": Only create additional .md files when user specifically asks for documentation","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"paragraph","content":[{"text":"Complete PowerShell expertise across all platforms for scripting, automation, CI/CD, and cloud management.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Activate","type":"text"}]},{"type":"paragraph","content":[{"text":"PROACTIVELY activate for ANY PowerShell-related task:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PowerShell Scripts","type":"text","marks":[{"type":"strong"}]},{"text":" - Creating, reviewing, optimizing any .ps1 file","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cmdlets & Modules","type":"text","marks":[{"type":"strong"}]},{"text":" - Finding, installing, using any PowerShell modules","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cross-Platform","type":"text","marks":[{"type":"strong"}]},{"text":" - Windows, Linux, macOS PowerShell tasks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CI/CD Integration","type":"text","marks":[{"type":"strong"}]},{"text":" - GitHub Actions, Azure DevOps, Bitbucket Pipelines","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cloud Automation","type":"text","marks":[{"type":"strong"}]},{"text":" - Azure (Az), AWS, Microsoft 365 (Microsoft.Graph)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Module Management","type":"text","marks":[{"type":"strong"}]},{"text":" - PSGallery search, installation, updates","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Script Debugging","type":"text","marks":[{"type":"strong"}]},{"text":" - Troubleshooting, performance, security","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Best Practices","type":"text","marks":[{"type":"strong"}]},{"text":" - Code quality, standards, production-ready scripts","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference Map","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed material lives in ","type":"text"},{"text":"references/","type":"text","marks":[{"type":"code_inline"}]},{"text":". Load only what the current task needs.","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Topic","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"File","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"When to load","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cross-platform patterns (paths, platform detection, encoding, shell detection)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/cross-platform-patterns.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Writing scripts that run on Windows + Linux/macOS, or distinguishing PowerShell vs Git Bash","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Module management (PSResourceGet, PSGallery, popular modules)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/modules-and-gallery.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Installing/finding modules, Az 14.5.0, Microsoft.Graph 2.32.0, PnP, AWS Tools, offline installs","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CI/CD pipelines (GitHub Actions, Azure DevOps, Bitbucket)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/cicd-integration.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Setting up automated PowerShell builds/tests with multi-platform matrices","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Syntax & cmdlet reference (variables, operators, flow, functions, pipeline, error handling, Pester, performance, REST)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/syntax-reference.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Authoring scripts, looking up cmdlets, writing Pester tests, performance tuning","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security (JEA, WDAC, Constrained Language Mode, Script Block Logging, credentials, code signing)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/security-2025.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Production security hardening, credential management, audit logging","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"PowerShell Overview","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"PowerShell Versions & Platforms","type":"text"}]},{"type":"paragraph","content":[{"text":"PowerShell 7+ (Recommended)","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cross-platform: Windows, Linux, macOS","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Open source, actively developed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Better performance than PowerShell 5.1","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"UTF-8 by default","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Parallel execution support","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ternary operators, null-coalescing","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Windows PowerShell 5.1 (Legacy)","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Windows-only","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ships with Windows","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"UTF-16LE default encoding","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Required for some Windows-specific modules","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Installation Locations:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Windows:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"C:\\Program Files\\PowerShell\\7\\","type":"text","marks":[{"type":"code_inline"}]},{"text":" (PS7) or ","type":"text"},{"text":"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\","type":"text","marks":[{"type":"code_inline"}]},{"text":" (5.1)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Linux:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/opt/microsoft/powershell/7/","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"/usr/bin/pwsh","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"macOS:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/usr/local/microsoft/powershell/7/","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"/usr/local/bin/pwsh","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Workflow","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify scope","type":"text","marks":[{"type":"strong"}]},{"text":" — Is this a script, module, automation pipeline, or one-off command? Note target platform(s).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check version & modules","type":"text","marks":[{"type":"strong"}]},{"text":" — ","type":"text"},{"text":"$PSVersionTable.PSVersion","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"Get-Module -ListAvailable","type":"text","marks":[{"type":"code_inline"}]},{"text":". Confirm PowerShell 7+ unless legacy required.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load the relevant reference(s)","type":"text","marks":[{"type":"strong"}]},{"text":" from the Reference Map above. Avoid loading material you do not need.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Apply the pre-flight checklist","type":"text","marks":[{"type":"strong"}]},{"text":" (below) before authoring or running production scripts.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Validate","type":"text","marks":[{"type":"strong"}]},{"text":" — ","type":"text"},{"text":"Invoke-ScriptAnalyzer","type":"text","marks":[{"type":"code_inline"}]},{"text":" for linting, ","type":"text"},{"text":"Invoke-Pester","type":"text","marks":[{"type":"code_inline"}]},{"text":" for tests, ","type":"text"},{"text":"-WhatIf","type":"text","marks":[{"type":"code_inline"}]},{"text":" for destructive cmdlets.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Pre-Flight Checklist for Scripts","type":"text"}]},{"type":"paragraph","content":[{"text":"Before running any PowerShell script, ensure:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Platform Detection","type":"text","marks":[{"type":"strong"}]},{"text":" - Use ","type":"text"},{"text":"$IsWindows","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"$IsLinux","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"$IsMacOS","type":"text","marks":[{"type":"code_inline"}]},{"text":" (see ","type":"text"},{"text":"references/cross-platform-patterns.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Version Check","type":"text","marks":[{"type":"strong"}]},{"text":" - ","type":"text"},{"text":"#Requires -Version 7.0","type":"text","marks":[{"type":"code_inline"}]},{"text":" if needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Module Requirements","type":"text","marks":[{"type":"strong"}]},{"text":" - ","type":"text"},{"text":"#Requires -Modules","type":"text","marks":[{"type":"code_inline"}]},{"text":" specified","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Error Handling","type":"text","marks":[{"type":"strong"}]},{"text":" - ","type":"text"},{"text":"try/catch","type":"text","marks":[{"type":"code_inline"}]},{"text":" blocks in place","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Input Validation","type":"text","marks":[{"type":"strong"}]},{"text":" - Parameter validation attributes used (see ","type":"text"},{"text":"references/syntax-reference.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"No Aliases","type":"text","marks":[{"type":"strong"}]},{"text":" - Full cmdlet names in scripts","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Path Handling","type":"text","marks":[{"type":"strong"}]},{"text":" - Use ","type":"text"},{"text":"Join-Path","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"[IO.Path]::Combine()","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Encoding Specified","type":"text","marks":[{"type":"strong"}]},{"text":" - UTF-8 for cross-platform","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Credentials Secure","type":"text","marks":[{"type":"strong"}]},{"text":" - Never hardcoded (see ","type":"text"},{"text":"references/security-2025.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verbose Logging","type":"text","marks":[{"type":"strong"}]},{"text":" - ","type":"text"},{"text":"Write-Verbose","type":"text","marks":[{"type":"code_inline"}]},{"text":" for debugging","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Decision Guide","type":"text"}]},{"type":"paragraph","content":[{"text":"Use PowerShell 7+ when:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cross-platform compatibility needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"New projects or scripts","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Performance is important","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Modern language features desired","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Use Windows PowerShell 5.1 when:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Windows-specific modules required (WSUS, GroupPolicy legacy)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Corporate environments with strict version requirements","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Legacy script compatibility needed","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Choose Azure CLI when:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Simple one-liners needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"JSON output preferred","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Bash scripting integration","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Choose PowerShell Az module when:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Complex automation required","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Object manipulation needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PowerShell scripting expertise available","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reusable scripts and modules needed","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Minimal Script Skeleton","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"powershell"},"content":[{"text":"#Requires -Version 7.0\n\n\u003c#\n.SYNOPSIS\n Brief description\n.DESCRIPTION\n Detailed description\n.PARAMETER Name\n Parameter description\n.EXAMPLE\n PS> .\\script.ps1 -Name \"John\"\n#>\n\n[CmdletBinding()]\nparam(\n [Parameter(Mandatory=$true)]\n [ValidateNotNullOrEmpty()]\n [string]$Name\n)\n\n$ErrorActionPreference = \"Stop\"\nSet-StrictMode -Version Latest\n\ntry {\n Write-Verbose \"Starting script\"\n # ... main logic ...\n Write-Verbose \"Script completed successfully\"\n}\ncatch {\n Write-Error \"Script failed: $_\"\n exit 1\n}\nfinally {\n # Cleanup\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"Expand this skeleton using patterns from ","type":"text"},{"text":"references/syntax-reference.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (advanced functions, pipeline, error handling) and ","type":"text"},{"text":"references/security-2025.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (input validation, credential handling).","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Additional Resources","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PowerShell Docs: https://learn.microsoft.com/powershell","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PowerShell Gallery: https://www.powershellgallery.com","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Az Module Docs: https://learn.microsoft.com/powershell/azure","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Microsoft Graph Docs: https://learn.microsoft.com/graph/powershell","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"For shell detection on Windows (PowerShell vs Git Bash), see the ","type":"text"},{"text":"powershell-shell-detection","type":"text","marks":[{"type":"code_inline"}]},{"text":" skill.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"paragraph","content":[{"text":"Remember: ALWAYS research latest PowerShell documentation and module versions before implementing solutions. The PowerShell ecosystem evolves rapidly, and best practices are updated frequently.","type":"text"}]}]},"metadata":{"date":"2026-11-02","name":"powershell-master","author":"@skillopedia","source":{"stars":59,"repo_name":"claude-plugin-marketplace","origin_url":"https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/HEAD/plugins/powershell-master/skills/powershell-master/SKILL.md","repo_owner":"JosiahSiegel","body_sha256":"cecea242f1def3a1e3109e04f213f2f584e3f1e213a3bf379babd25fca82df10","cluster_key":"db219db83d372c8f7ebe0341a2f9644d87a2df4ff5eb5590f311ba96801a2011","clean_bundle":{"format":"clean-skill-bundle-v1","source":"JosiahSiegel/claude-plugin-marketplace/plugins/powershell-master/skills/powershell-master/SKILL.md","text_bytes":25359,"source_commit":"5a1b1123b9e50aa9a66a61005ca6fe012cc7442d","skills_sh_rank":12258,"attachment_count":5,"text_attachments":5,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"plugins/powershell-master/skills/powershell-master/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"devops-infrastructure","category_label":"DevOps"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"devops-infrastructure","import_tag":"skills-sh-top20k-2026-11","description":"Complete PowerShell expertise system across ALL platforms (Windows/Linux/macOS).\nPROACTIVELY activate for: (1) ANY PowerShell task (scripts/modules/cmdlets), (2) CI/CD automation (GitHub Actions/Azure DevOps/Bitbucket), (3) Cross-platform scripting, (4) Module discovery and management (PSGallery), (5) Azure/AWS/Microsoft 365 automation, (6) Script debugging and optimization, (7) Best practices and security.\nProvides: PowerShell 7+ features, popular module expertise (Az, Microsoft.Graph, PnP, AWS Tools), PSGallery integration, platform-specific guidance, CI/CD pipeline patterns, cmdlet syntax mastery, and production-ready scripting patterns.\nEnsures professional-grade, cross-platform PowerShell automation following industry standards.\n"}},"renderedAt":1793665950861}

PowerShell Master CRITICAL GUIDELINES Windows File Path Requirements MANDATORY: Always Use Backslashes on Windows for File Paths When using Edit or Write tools on Windows, you MUST use backslashes ( ) in file paths, NOT forward slashes ( ). Examples: - WRONG: - CORRECT: This applies to: - Edit tool file path parameter - Write tool file path parameter - All file operations on Windows systems Documentation Guidelines NEVER create new documentation files unless explicitly requested by the user. - Priority : Update existing README.md files rather than creating new documentation - Repository clean…