Skip to content
Skills Library
DevOps & cloud · Automation

powershell-essentials

/powershell-essentials

Write PowerShell that leans on the object pipeline, handles errors deliberately, and runs cross-platform where needed. Use when automating Windows or writing pwsh scripts for mixed fleets.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Write PowerShell that leans on the object pipeline, handles errors deliberately, and runs cross-platform where needed. Use when automating Windows or writing pwsh scripts for mixed fleets.

Original author description

Write PowerShell that leans on the object pipeline, handles errors deliberately, and runs cross-platform where needed. Use when automating Windows or writing pwsh scripts for mixed fleets.

How it works

  1. Method
  2. Boundaries
Original SKILL.md headings · 66 lines, 428 words
SKILL.md preview
---
name: powershell-essentials
description: Write PowerShell that leans on the object pipeline, handles errors deliberately, and runs cross-platform where needed. Use when automating Windows or writing pwsh scripts for mixed fleets.
---

# PowerShell essentials

PowerShell pipes objects, not text: the entire design follows from
that. Scripts that treat it as bash-with-verbs fight the tool; scripts
that filter and shape objects get parsing for free.

## Method

1. **Stay in objects until the last step.** `Get-Process |
   Where-Object CPU -gt 100 | Select-Object Name, Id`: no regex,
   no cut/awk. Convert to text (Format-*, Out-*) only at final
   display; Format cmdlets destroy the objects, so never put them
   mid-pipeline. For interop, `ConvertTo-Json`/`ConvertFrom-Json`
   round-trip structures (the text-processing "structured first"
   rule is the default here).
2. **Make errors terminating where correctness matters.**
   Non-terminating errors continue by default: set
   `$ErrorActionPreference = 'Stop'` at script top (and know
   native executables still need `$LASTEXITCODE` checks;
   PSNativeCommandErrorActionPreference in pwsh 7.4+ closes that
   gap). `try/catch` around the operations you can handle;
   `-ErrorAction SilentlyContinue` only with a comment defending
   the swallow (the bash-robustness `|| true` rule, translated).
3. **Write functions as advanced functions.**
   `[CmdletBinding()]`, typed `param()` blocks with validation
   attributes (`[ValidateNotNullOrEmpty()]`, `[ValidateSet(...)]`),
   `SupportsShouldProcess` for anything destructive so `-WhatIf`
   and `-Confirm` work fleet-wide (see automation-guardrails):
   this is the platform's built-in dry-run, use it. Verb-Noun
   names from `Get-Verb`; comment-based help for anything shared.
4. **Structure scripts like the CLI contract they are.** Param
   block at top (positional for the common case, named for the
   rest), objects to the output stream (so callers can pipe),
   diagnostics via `Write-Verbose`/`Write-Warning` (never
   `Write-Host` for data), exit codes for CI consumption (see
   python-cli-tools: same contract, different runtime).
   `Set-StrictMode -Version Latest` catches typo'd variables the
   way `set -u` does.
5. **Target the right edition per fleet.** pwsh (7+) is
   cross-platform and actively developed: default for new work,
   including Linux containers and CI. Windows PowerShell 5.1 is
   what stock Windows guarantees: constrain to compatible syntax
   (or ship pwsh) when targeting unmanaged Windows boxes; module
   availability differs, so CI-test on the editions you claim
   (the shell-portability matrix ethic).
6. **Lint and test like real code.** PSScriptAnalyzer in CI
   (see linting-setup), Pester for unit tests of functions
   (mock cmdlets, assert on objects: see test-doubles); modules
   (`.psm1` + manifest) over dot-sourced script piles once
   functions are shared (see python-project-structure instincts).

## Boundaries

- Remoting, DSC, and AD administration are their own disciplines
  with security surface (JEA, credential handling: see
  least-privilege, secrets-management); this skill covers the
  scripting core beneath them.
- Text-native interop (parsing legacy tool output) loses the
  object advantage; for heavy text pipelines on Linux, classic
  tools may serve better (see text-processing): choose per job.
- Performance-sensitive loops over huge collections can crawl in
  the pipeline; measure and drop to .NET methods
  (`[IO.File]::ReadLines`) where profiles demand (see
  benchmark-design), not preemptively.

Versions

The database has no other skills named powershell-essentials.

Database snapshot: 13.11.2026 · package version a94f1dec5fac (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100powershell
    Expert PowerShell assistance covering cmdlet pipelines, object manipulation, modules, and cross-platform scripting. Use when automating Windows/Azure administration, creating scripts, or managing DevOps tasks.
  • 98powershell-core
    Use when writing PowerShell scripts or automating tasks with PowerShell 7+ (the cross-platform edition). Covers cmdlet patterns, pipeline, objects vs text, modules, error handling, remoting, and differences from Windows PowerShell 5.1. USE FOR: PowerShell 7, PowerShell Core,…
  • 100windows-powershell-cmdlets-pipeline
    Use this skill when automating administrative workflows passing structured .NET objects across the PowerShell command pipeline.
  • 96powershell
    PowerShell开发专家助手。当用户需要进行PowerShell脚本开发、Windows自动化、系统运维脚本、模块开发或跨平台管理任务时调用。
  • 98powershell-safe-invocation
    Use when writing or running PowerShell on Windows, especially native programs, quoted paths, escaping, pwsh, Start-Process, file operations, or shell troubleshooting.
  • 98powershell-safe-invocation
    Use when writing or running PowerShell on Windows, especially native programs, quoted paths, escaping, pwsh, Start-Process, file operations, or shell troubleshooting.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.