{
  "id": "cmd.ps51-join-and-utf8-safe",
  "version": 1,
  "category": "command_snippet",
  "severity": "low",
  "lifecycleStatus": "ACTIVE",
  "lifecycle": {
    "status": "ACTIVE",
    "appliesTo": "Windows PowerShell 5.1",
    "verifiedAt": 1795800000000,
    "reviewDueAt": 1858872000000,
    "replacedBy": "",
    "retireReason": ""
  },
  "contentOrigin": "HUMAN_ORIGINAL",
  "aiModel": "",
  "summaryEn": "Safe Windows PowerShell 5.1 pattern using `-join` instead of `Join-String` and ASCII-safe scripts to prevent UTF-8 parsing breaks.",
  "match": {
    "field": "command",
    "containsAny": [
      "join-string -separator",
      "join-string -outputprefix"
    ]
  },
  "actions": [
    "EXPLAIN_TO_USER"
  ],
  "indicators": [],
  "knowledge": {
    "environment": "Windows PowerShell 5.1 (built-in Windows desktop edition)",
    "symptom": "Scripts fail with `Join-String is not recognized` or break string parsing on UTF-8 em-dashes without BOM.",
    "rootCause": "`Join-String` exists only in PowerShell 6+/7+, and PowerShell 5.1 reads UTF-8 files without BOM using the local Windows code page.",
    "verifiedFix": "Use the native `-join ', '` operator for joining arrays and keep `.ps1` automation scripts pure ASCII (or UTF-8 with BOM when Unicode literals are needed).",
    "verificationCheck": "Execute the script under `powershell.exe -NoProfile` and verify clean exit code 0.",
    "commandPattern": "$items -join ', '",
    "commandRisk": "READ_ONLY",
    "license": "CC0-1.0",
    "sourceBasis": "SELF_AUTHORED_FIX"
  },
  "playbookSha256": "8493adca6828da037f5d3056f0162b18023326e60fcb8601efadac00c369ab0a",
  "snapshotSha256": "116114a19ef52fd932a20216d0c0a4136c3ef2489839d44e6e031683fb594cd2",
  "advisoryOnly": true
}
