powershell-windows — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited powershell-windows (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
PowerShell has a handful of sharp edges that bite predictably. The rules below are not stylistic preferences -- ignoring them produces parser errors or silent wrong behavior.
When a cmdlet result feeds a logical operator, wrap the call in parentheses. The parser otherwise treats -or/-and as a parameter to the cmdlet.
# Breaks: -or is read as an argument to Test-Path
if (Test-Path $a -or Test-Path $b) { ... }
# Works: each call is its own grouped expression
if ((Test-Path $a) -or (Test-Path $b)) { ... }
# Same rule with a comparison on one side
if ((Get-Item $p) -and ($count -eq 5)) { ... }Non-ASCII glyphs (emoji, check marks, box drawing) cause "Unexpected token" errors on many Windows consoles and code pages. Use bracketed ASCII tags instead.
| Meaning | Avoid | Use |
|---|---|---|
| Success | check / tick marks | [OK] [+] |
| Failure | cross / red circle | [X] [!] |
| Warning | warning sign | [WARN] [*] |
| Info | info symbol | [INFO] [i] |
| In progress | hourglass | [...] |
Touching a property or method on $null throws -- and under Set-StrictMode even reading an unset variable does. Check first.
# Risky
if ($items.Count -gt 0) { ... }
$len = $name.Length
# Safe
if ($items -and $items.Count -gt 0) { ... }
if ($name) { $len = $name.Length }Interpolating a multi-hop property chain inside a string is fragile. Assign it to a variable, then interpolate the variable.
# Fragile
Write-Output "City: $($order.customer.address.city)"
# Clear
$city = $order.customer.address.city
Write-Output "City: $city"$ErrorActionPreference sets how non-terminating errors behave:
| Value | Fits |
|---|---|
Stop | development -- fail loudly and early |
Continue | production scripts that should push through |
SilentlyContinue | spots where an error is expected and fine |
In try/catch: do not return from inside the try, put cleanup in finally, and return after the whole block resolves.
Prefer Join-Path over hand-concatenated strings -- it handles separators correctly and reads clearly.
$literal = "C:\Users\Sam\report.txt" # fixed location
$inHome = Join-Path $env:USERPROFILE "report.txt"
$relative = Join-Path $ScriptDir "data"$items = @() # initialize empty
$items += $next # append (fine for small sets)
$list.Add($next) | Out-Null # ArrayList: suppress the index it returnsConvertTo-Json truncates nested structures at a shallow default. Pass -Depth whenever objects nest.
# Loses nested data
$obj | ConvertTo-Json
# Keeps it
$obj | ConvertTo-Json -Depth 10
# Round-tripping a file
$data = Get-Content "config.json" -Raw | ConvertFrom-Json
$data | ConvertTo-Json -Depth 10 | Out-File "config.json" -Encoding UTF8| Message | Likely cause | Fix |
|---|---|---|
parameter 'or' not found | cmdlet not parenthesized | wrap each call in () |
| Unexpected token | non-ASCII character | use ASCII tags |
| property cannot be found on null | dereferenced $null | null-check first |
| cannot convert value | type mismatch | coerce with .ToString() etc. |
Set-StrictMode -Version Latest
$ErrorActionPreference = "Continue"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
try {
# work goes here
Write-Output "[OK] Completed"
exit 0
}
catch {
Write-Warning "Failed: $_"
exit 1
}The recurring theme: parenthesize cmdlet calls in conditions, keep output ASCII, and never assume a value is non-null. Those three cover the majority of PowerShell breakage on Windows.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.