powershell — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited powershell (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.
cannot be retrieved via live search.
$ErrorActionPreference = 'Stop'git, robocopy) in PowerShell 7.3 and newer:$PSNativeCommandUseErrorActionPreference = $truetry, catch, and finally blocks for all operations that interact with the filesystem, network,or external APIs to gracefully handle terminating errors.
[int], [string]) to prevent runtime typemismatch errors.
#Requires statements and parameter validation attributes;print a usage message and exit on invalid input.
Every reusable script block must be written as an advanced function:
function Invoke-MyOperation {
[CmdletBinding(SupportsShouldProcess)]
param (
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string]$InputPath,
[Parameter()]
[ValidateRange(1, 100)]
[int]$MaxRetries = 3
)
begin {
Write-Verbose "Starting Invoke-MyOperation"
}
process {
if ($PSCmdlet.ShouldProcess($InputPath, 'Process')) {
# operation logic
}
}
end {
Write-Verbose "Completed Invoke-MyOperation"
}
}[CmdletBinding()] on functions to enable -Verbose, -Debug, -WhatIf, and -Confirm support.SupportsShouldProcess for any function that modifies state; guard mutations with $PSCmdlet.ShouldProcess(...).Use validation attributes on every parameter that has constraints:
[ValidateNotNullOrEmpty()] for required strings.[ValidateRange(min, max)] for numeric bounds.[ValidateSet('Value1', 'Value2')] for enumerated values.[ValidatePattern('^regex$')] for format-constrained strings.Mark mandatory parameters with [Parameter(Mandatory)]; do not rely on runtime null checks for required inputs.
Organise reusable code as PowerShell modules with a .psm1 implementation file and a .psd1 manifest. Export only public functions in the module manifest (FunctionsToExport); keep internal helpers unexported.
Use the following module directory layout:
MyModule/
MyModule.psd1 # Module manifest
MyModule.psm1 # Dot-sources private functions, exports public ones
Public/ # Exported functions (one file per function)
Private/ # Internal helpers
Tests/ # Pester test filesWrite-Verbose for diagnostic messages (visible with -Verbose).Write-Warning for recoverable issues that do not stop execution.Write-Error for non-terminating errors; use throw for terminating errors.Write-Host in library/module code; it bypasses the pipeline and cannot be captured. Use Write-Output fordata and Write-Verbose/Write-Information for status messages.
[string]; use [SecureString] or [PSCredential].appear in process lists).
PowerShell module) at runtime.
PSGallery ruleset; zero warnings/errors policy.[Diagnostics.CodeAnalysis.SuppressMessageAttribute] accompanied by ajustification comment.
Describe / Context / It blocks.Mock and verify calls with Should -Invoke.BeforeAll / AfterAll for setup and teardown; do not use BeforeEach for expensive setup that can be shared.#Requires -Version 7.2.
Get-WmiObject, Get-EventLog) without an OS guard:if ($IsWindows) { ... } elseif ($IsLinux) { ... } elseif ($IsMacOS) { ... }[System.IO.Path]::Combine() or Join-Path for all path construction to ensure cross-platform path separators.See observability-and-logging → "Startup readiness log" for the universal convention (ANSI Shadow banner, URL + profile + dependency + observability sections, 2-second probe timeouts, <url> [Connected|Warning|FAILED] result format).
For PowerShell-orchestrated long-running services (Windows scheduled tasks, service wrappers, polling daemons), Write-Host the banner with a here-string right before the main loop or Start-Process:
@'
███████╗██╗ ██╗██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔════╝██║ ██║██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗
███████╗██║ ██║██████╔╝██████╔╝██║ ██║█████╗ ██████╔╝
╚════██║██║ ██║██╔═══╝ ██╔═══╝ ██║ ██║██╔══╝ ██╔══██╗
███████║╚██████╔╝██║ ██║ ███████╗██║███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝
'@ | Write-HostThe console host on PowerShell 7+ defaults to UTF-8; the box-drawing characters render natively. Legacy powershell.exe (Windows PowerShell 5.1) needs [Console]::OutputEncoding = [Text.Encoding]::UTF8 set once before printing.
Probe timeouts: Invoke-WebRequest -Uri <url> -TimeoutSec 2, wrapped in try { ... } catch { ... } so an unreachable dependency doesn't bubble:
function Test-StartupProbe {
param([string]$Url)
try {
$response = Invoke-WebRequest -Uri $Url -TimeoutSec 2 -UseBasicParsing -ErrorAction Stop
if ($response.StatusCode -lt 400) {
"$Url [Connected]"
} else {
"$Url [Warning] (status=$($response.StatusCode))"
}
} catch {
Write-Debug "Startup probe failed: $Url ($($_.Exception.Message))"
"$Url [FAILED]"
}
}~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.