powershell-windows
Master PowerShell Windows Scripting Patterns
Avoid common PowerShell pitfalls that cause script failures. Learn proper operator syntax, error handling, and Windows-specific patterns for reliable automation.
Baixar o ZIP da skill
Upload no Claude
Vá em Configurações → Capacidades → Skills → Upload skill
Ative e comece a usar
Testar
A utilizar "powershell-windows". Check if file exists or directory exists
Resultado esperado:
Use: if ((Test-Path "file.txt") -or (Test-Path "folder")) - Each cmdlet must be wrapped in parentheses when using logical operators
A utilizar "powershell-windows". Safely get array length
Resultado esperado:
Use: if ($array -and $array.Count -gt 0) - Always verify the array exists before accessing properties
A utilizar "powershell-windows". Convert nested object to JSON
Resultado esperado:
Use: $data | ConvertTo-Json -Depth 10 - Always specify depth parameter for nested objects to avoid truncation
Auditoria de Segurança
SeguroStatic analysis detected 34 patterns but all are false positives. The SKILL.md file is documentation only, containing PowerShell syntax examples and best practices. No executable code or security risks present. The skill is a reference guide for proper PowerShell scripting patterns on Windows.
Fatores de risco
⚙️ Comandos externos (7)
Pontuação de qualidade
O Que Você Pode Construir
DevOps Engineer Scripting
Create reliable Windows automation scripts with proper error handling and null safety for CI/CD pipelines
System Administrator Reference
Quick reference for PowerShell syntax rules and common pitfalls when maintaining legacy scripts
Developer Learning Resource
Learn PowerShell best practices and avoid common mistakes when adding Windows scripting to your toolkit
Tente Estes Prompts
What is the correct PowerShell syntax for checking if a file exists OR another condition is true?
Show me the proper try-catch-finally pattern for PowerShell scripts that need to clean up resources
How do I safely check if an array has items before accessing its Count property in PowerShell?
What is the correct way to read and write JSON files in PowerShell with nested objects?
Melhores Práticas
- Wrap each cmdlet in parentheses when using logical operators like -or and -and
- Always check for null before accessing object properties or methods
- Use Join-Path for building file paths instead of string concatenation
- Set ErrorActionPreference appropriately for your environment (Stop for dev, Continue for production)
- Specify -Depth parameter when converting nested objects to JSON
Evitar
- Using unicode or emoji characters in PowerShell scripts - use ASCII markers like [OK] instead
- Accessing properties without null checks - will cause runtime errors on null values
- Using ConvertTo-Json without -Depth parameter - nested objects will be truncated
- Placing return statements inside try blocks - use finally for cleanup and return after
Perguntas Frequentes
Why do PowerShell logical operators require extra parentheses?
What is the safest way to handle file paths in PowerShell?
Why should I avoid unicode characters in PowerShell scripts?
What ErrorActionPreference should I use in production?
How do I properly convert nested objects to JSON?
What is the correct pattern for null-safe array access?
Detalhes do Desenvolvedor
Autor
sickn33Licença
MIT
Repositório
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/powershell-windowsReferência
main
Estrutura de arquivos
📄 SKILL.md