Skip to content
Back to skills

Powershell 5.1 Expert

ASecurity

Expert in legacy Windows PowerShell 5.1. Specializes in WMI, ADSI, COM automation, and maintaining backward compatibility with Windows Server environments. Use for Windows-specific automation on legacy systems. Triggers include "PowerShell 5.1", "Windows PowerShell", "WMI", "ADSI", "COM object", "legacy PowerShell".

  • 221 stars
  • 0 votes
  • 1 copy
  • 11 views
  • Added September 4, 2026
securityshellsecurityperformance

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill powershell-5.1-expert --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Powershell 5.1 Expert?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Powershell 5.1 Expert
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-powershell-5-1-expert/badge)](https://www.skillsdirectory.com/skills/neversight-powershell-5-1-expert)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: powershell-5.1-expert
description: Expert in legacy Windows PowerShell 5.1. Specializes in WMI, ADSI, COM automation, and maintaining backward compatibility with Windows Server environments. Use for Windows-specific automation on legacy systems. Triggers include "PowerShell 5.1", "Windows PowerShell", "WMI", "ADSI", "COM object", "legacy PowerShell".
---

# PowerShell 5.1 Expert

## Purpose
Provides expertise in Windows PowerShell 5.1 for legacy Windows environments. Specializes in WMI queries, ADSI operations, COM automation, and maintaining scripts compatible with older Windows Server systems.

## When to Use
- Scripting for Windows Server 2012/2016/2019
- Working with WMI for system management
- Active Directory operations via ADSI
- COM automation (Office, legacy apps)
- Maintaining backward compatibility
- DSC (Desired State Configuration)
- Windows-specific automation
- Legacy script maintenance

## Quick Start
**Invoke this skill when:**
- Working with Windows PowerShell 5.1 specifically
- Using WMI for system queries
- Automating with ADSI or COM objects
- Maintaining legacy PowerShell scripts
- DSC configuration management

**Do NOT invoke when:**
- Cross-platform PowerShell → use `/powershell-7-expert`
- GUI/TUI development → use `/powershell-ui-architect`
- Security hardening → use `/powershell-security-hardening`
- Module architecture → use `/powershell-module-architect`

## Decision Framework
```
PowerShell Version Context?
├── Must run on older Windows
│   └── Use 5.1 with WMI/ADSI
├── Cross-platform needed
│   └── Use PowerShell 7+ instead
├── AD Management
│   ├── Simple → ADSI
│   └── Complex → AD Module
└── System Info
    ├── Legacy → WMI
    └── Modern → CIM (also works in 5.1)
```

## Core Workflows

### 1. WMI System Query
1. Identify WMI class (Win32_*)
2. Construct WMI query
3. Use Get-WmiObject or Get-CimInstance
4. Filter results appropriately
5. Format output
6. Handle errors for remote systems

### 2. ADSI Operations
1. Create DirectoryEntry object
2. Navigate LDAP path
3. Query or modify attributes
4. Commit changes if modifying
5. Handle authentication
6. Clean up resources

### 3. COM Automation
1. Create COM object with New-Object -ComObject
2. Access object model
3. Perform operations
4. Handle COM errors
5. Release COM objects properly
6. Clean up with [System.Runtime.InteropServices.Marshal]

## Best Practices
- Use CIM cmdlets over WMI when possible (better remoting)
- Always include error handling for remote operations
- Release COM objects explicitly to prevent memory leaks
- Test on target Windows versions
- Document required PowerShell modules
- Use approved verbs for functions

## Anti-Patterns
| Anti-Pattern | Problem | Correct Approach |
|--------------|---------|------------------|
| Not releasing COM | Memory leaks | Explicit cleanup |
| WMI over slow networks | Performance issues | Use CIM with sessions |
| No error handling | Silent failures | Try/Catch with logging |
| Hardcoded paths | Portability issues | Use environment variables |
| Write-Host for output | Can't capture | Write-Output or return |

Files in this skill

  • SKILL.md3.1 KB
  • description_ar.txt468 B
  • description_cn.txt332 B
  • description_de.txt392 B
  • description_en.txt318 B
  • description_es.txt350 B
  • description_fr.txt407 B
  • description_it.txt380 B
  • description_ja.txt426 B
  • description_ko.txt373 B
  • description_ru.txt572 B
  • description_tw.txt332 B
  • stats.json66 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.