skills/hmohamed01/powershell-expert/SKILL.md
Develop PowerShell scripts, tools, modules, and GUIs following Microsoft best practices. Use when writing PowerShell code, creating Windows Forms/WPF interfaces, working with PowerShell Gallery modules, or needing cmdlet/module recommendations. Covers script development, parameter design, pipeline handling, error management, and GUI creation patterns. Verifies module availability and cmdlet syntax against live documentation when accuracy is critical.
npx skillsauth add aiskillstore/marketplace powershell-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Develop production-quality PowerShell scripts, tools, and GUIs using Microsoft best practices and the PowerShell ecosystem.
#Requires -Version 5.1
<#
.SYNOPSIS
Brief description.
.DESCRIPTION
Detailed description.
.PARAMETER Name
Parameter description.
.EXAMPLE
Example-Usage -Name 'Value'
#>
[CmdletBinding()]
param(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]]$Name,
[switch]$Force
)
begin {
# One-time setup
}
process {
foreach ($item in $Name) {
# Per-item processing
}
}
end {
# Cleanup
}
function Verb-Noun {
[CmdletBinding(SupportsShouldProcess)]
param(
[Parameter(Mandatory, Position = 0)]
[string]$Name,
[Parameter(ValueFromPipelineByPropertyName)]
[Alias('CN')]
[string]$ComputerName = $env:COMPUTERNAME,
[switch]$PassThru
)
process {
if ($PSCmdlet.ShouldProcess($Name, 'Action')) {
# Implementation
if ($PassThru) { Write-Output $result }
}
}
}
Follow naming and parameter conventions:
Get-Verb)ValueFromPipelineSee best-practices.md for complete guidelines.
Windows Forms for simple dialogs, WPF/XAML for complex interfaces:
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object System.Windows.Forms.Form -Property @{
Text = 'Title'
Size = New-Object System.Drawing.Size(400, 300)
StartPosition = 'CenterScreen'
}
See gui-development.md for controls, events, and templates.
Search and install modules using PSResourceGet:
# Search gallery
Find-PSResource -Name 'ModuleName' -Repository PSGallery
# Install module
Install-PSResource -Name 'ModuleName' -Scope CurrentUser -TrustRepository
Use scripts/Search-Gallery.ps1 for enhanced search.
See powershellget.md for full cmdlet reference.
try {
$result = Get-Content -Path $Path -ErrorAction Stop
}
catch [System.IO.FileNotFoundException] {
Write-Error "File not found: $Path"
return
}
catch {
throw
}
$params = @{
Path = $sourcePath
Destination = $destPath
Recurse = $true
Force = $true
}
Copy-Item @params
# Stream output immediately
foreach ($item in $collection) {
Process-Item $item | Write-Output
}
# Accept pipeline input
param(
[Parameter(ValueFromPipeline)]
[string[]]$InputObject
)
process {
foreach ($obj in $InputObject) {
# Process each
}
}
When recommending modules, search the PowerShell Gallery:
| Category | Popular Modules |
|----------|----------------|
| Azure | Az, Az.Compute, Az.Storage |
| Testing | Pester, PSScriptAnalyzer |
| Console | PSReadLine, Terminal-Icons |
| Secrets | Microsoft.PowerShell.SecretManagement |
| Web | Pode (web server), PoshRSJob (async) |
| GUI | WPFBot3000, PSGUI |
You MUST verify information against live sources when accuracy is critical. Do not rely solely on training data for module availability or cmdlet syntax.
Tools to use:
| Scenario | Action | |----------|--------| | User asks "does module X exist?" | MUST verify via PowerShell Gallery | | Recommending a specific module | MUST verify it exists and isn't deprecated | | Providing exact cmdlet syntax | SHOULD verify against Microsoft Docs | | Module version requirements | MUST check gallery for current version | | General best practices | Static references are sufficient |
When recommending or checking a module, use the WebFetch tool to verify it exists:
WebFetch call:
https://www.powershellgallery.com/packages/{ModuleName}Extract: module name, latest version, last updated date, total downloads, and whether it shows any deprecation warning or 'unlisted' statusIf WebFetch returns 404 or error: The module likely doesn't exist. Use the WebSearch tool to confirm:
{ModuleName} PowerShell module site:powershellgallery.comMicrosoft Docs URLs vary by module. Use the WebSearch tool to find the correct documentation page:
WebSearch call:
{Cmdlet-Name} cmdlet site:learn.microsoft.com/en-us/powershellThen use WebFetch on the returned URL with prompt:
Extract the complete cmdlet syntax, required vs optional parameters, and PowerShell version requirementsIf the WebFetch or WebSearch tools are unavailable or return errors:
For module verification: Execute Search-Gallery.ps1 from this skill:
~/.claude/skills/powershell-expert/scripts/Search-Gallery.ps1 -Name 'ModuleName'
For cmdlet syntax: Suggest the user run locally:
Get-Help Cmdlet-Name -Full
Get-Command Cmdlet-Name -Syntax
Clearly state uncertainty: If verification fails, tell the user:
"I wasn't able to verify this against live documentation. Please confirm the module exists by running:
Find-PSResource -Name 'ModuleName'"
Good (verified with live data):
"The ImportExcel module (v7.8.10, updated Oct 2024, 17M+ downloads) provides Export-Excel for creating spreadsheets without Excel installed."
Bad (unverified claim):
"Use the Excel-Tools module to export data." ← May not exist!
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.