Skip to content
aiWikis.org

PowerShell Coding Standard

PowerShell scripts are operational code. Keep them readable, idempotent, and safe to rerun.

Metadata

FieldValue
Source siteaiwikis.org
Source URLhttps://aiwikis.org/
Canonical AIWikis URLhttps://aiwikis.org/files/aiwikis/wiki-global-coding-standards-powershell-md-8a2b30b3/
Source referencewiki/global/coding-standards/powershell.md
File typemd
Content categoryllm-wiki
Last fetched2026-05-08T21:22:18.3035107Z
Last changed2026-05-08T02:37:10.1743477Z
Content hashsha256:8a2b30b3f0ee5bb1ba2e87f21da09b46d9163cdd35d2109544db9a10a54d50a5
Import statusunchanged
Raw source layerdata/sources/aiwikis/wiki-global-coding-standards-powershell-md-8a2b30b3f0ee.md
Normalized source layerdata/normalized/aiwikis/wiki-global-coding-standards-powershell-md-8a2b30b3f0ee.txt

Current File Content

Structure Preview

  • PowerShell Coding Standard
  • Script Shape
  • Safety
  • Verification

Raw Version

---
uai_id: "bfac560c-7ffe-48e6-8258-7f38384210b6"
type: "coding-standard"
owner: "AIWikis maintainers"
status: "reviewed"
source_system: "AIWikis.org global"
source_status: "local synthesis from multisite scripting and verification practice"
sensitivity: "public-safe source-side memory"
agent_use: "load for PowerShell scripts, package helpers, SQL runners, and handoff checks"
lineage:
  - "wiki/global/coding-standards/index.md"
  - "wiki/uaix/index.md"
  - "wiki/protocol5/index.md"
  - "wiki/index.md"
source_trace:
  - "wiki/global/coding-standards/powershell.md"
confidence: 0.83
confidence_label: "reviewed-local"
last_linted: "2026-05-08T00:00:00Z"
handoff_export: "include"
aliases:
  - "PowerShell Coding Standard"
  - "Global Script Standard"
---

# PowerShell Coding Standard

PowerShell scripts are operational code. Keep them readable, idempotent, and safe to rerun.

## Script Shape

- Use `param(...)` blocks, clear switches, and explicit defaults.
- Set `$ErrorActionPreference = 'Stop'` for scripts that perform project work.
- Quote paths with `-LiteralPath` when the value comes from a filesystem lookup.
- Keep SQL strings parameterized when runtime values enter SQL.
- Separate read-only checks from mutating actions with explicit switches.

## Safety

- Do not auto-execute dropped intake files.
- Do not add scheduled pickup, watchers, or CI jobs for local handoff workflows unless a project explicitly approves that design.
- Before recursive delete or move operations, resolve the target and confirm it is inside the intended workspace.
- Prefer native PowerShell filesystem cmdlets over shelling out for file mutation.

## Verification

- Parser-check scripts after meaningful edits.
- Keep output concise but specific enough for a human to understand what changed.
- Write logs under the project's established diagnostics or `dist/logs` path when a helper already uses one.

Why This File Exists

This is a LLM Wiki memory file from aiwikis.org. It is shown here because AIWikis.org is demonstrating the real source files that make the UAIX / LLM Wiki memory system work, not only summarizing those systems after the fact.

Role

This file belongs to the source-side wiki layer. It preserves a focused concept, source proxy, graph record, or operating rule so the public site can cite reviewed conclusions without flattening every reason into a single long page.

Structure

The file is structured around these visible headings: PowerShell Coding Standard; Script Shape; Safety; Verification. Those headings are retrieval anchors: a crawler or LLM can decide whether the file is relevant before reading every line.

Prompt-Size And Retrieval Benefit

Keeping this material in a separate file reduces prompt pressure because an agent can load this exact unit only when its role, source site, category, or hash is relevant. The surrounding index pages point to it, while this page preserves the full content for audit and exact recall.

How To Use It

  • Humans should read the metadata first, then inspect the raw content when they need exact wording or provenance.
  • LLMs and agents should use the source site, category, hash, headings, and related files to decide whether this file belongs in the active prompt.
  • Crawlers should treat the AIWikis page as transparent evidence and follow the source URL/source reference for authority boundaries.
  • Future maintainers should regenerate this page whenever the source hash changes, then review the explanation if the role or structure changed.

Update Requirements

When this source file changes, update the raw source layer, normalized source layer, hash history, this rendered page, generated explanation, source-file inventory, changed-files report, and any source-section index that links to it.

Related Pages

Provenance And History

  • Current observation: 2026-05-08T21:22:18.3035107Z
  • Source origin: current-source-workspace
  • Retrieval method: local-source-workspace
  • Duplicate group: sfg-393 (primary)
  • Historical hash records are stored in data/hashes/source-file-history.jsonl.

Machine-Readable Metadata

{
    "title":  "PowerShell Coding Standard",
    "source_site":  "aiwikis.org",
    "source_url":  "https://aiwikis.org/",
    "canonical_url":  "https://aiwikis.org/files/aiwikis/wiki-global-coding-standards-powershell-md-8a2b30b3/",
    "source_reference":  "wiki/global/coding-standards/powershell.md",
    "file_type":  "md",
    "content_category":  "llm-wiki",
    "content_hash":  "sha256:8a2b30b3f0ee5bb1ba2e87f21da09b46d9163cdd35d2109544db9a10a54d50a5",
    "last_fetched":  "2026-05-08T21:22:18.3035107Z",
    "last_changed":  "2026-05-08T02:37:10.1743477Z",
    "import_status":  "unchanged",
    "duplicate_group_id":  "sfg-393",
    "duplicate_role":  "primary",
    "related_files":  [

                      ],
    "generated_explanation":  true,
    "explanation_last_generated":  "2026-05-08T21:22:18.3035107Z"
}