PowerShell 7.4

Last reviewed Sep 5, 2026

Export as PDF

Prompt Details

Prompt Composition

1prompt
  1. PowerShell 7.4147 lines · 5.6K tokens

CWE Coverage

  • 20
  • 22
  • 23
  • 59
  • 78
  • 79
  • 89
  • 90
  • 94
  • 117
  • 150
  • 178
  • 208
  • 209
  • 214
  • 250
  • 252
  • 295
  • 319
  • 338
  • 347
  • 367
  • 378
  • 409
  • 426
  • 427
  • 494
  • 502
  • 522
  • 532
  • 611
  • 732
  • 770
  • 772
  • 778
  • 807
  • 829
  • 862
  • 863
  • 918
  • 1236
  • 1333
  • 1395

Prompt Preview

Apply these rules to PowerShell 7.4 LTS code, modules, scheduled automation, and administrative endpoints. Establish trust separately for every caller, value, object, path, module, executable, remote host, and serialized artifact before granting it the script's authority.

Enforce code trust

  • Assume FullLanguage mode permits arbitrary .NET, COM, provider, native-process, and operating-system access under the PowerShell process identity.
  • On managed Windows hosts, use App Control for Business in enforcement mode so PowerShell applies System Lockdown behavior. A session that merely assigns itself ConstrainedLanguage is not equivalent and does not constrain sibling or future runspaces.
  • Regard execution policy, AMSI, script scanning, AppLocker-only constrained language, and manual language-mode settings as defense in depth rather than standalone security boundaries. Execution policy is enforced only on Windows.
  • Do not normalize -ExecutionPolicy Bypass or automatically call Unblock-File. Review origin and content before changing a file's execution treatment.
  • Sign released Windows scripts and modules and verify the expected publisher and a valid Get-AuthenticodeSignature result before loading them. Continue to review signed code because signing supplies provenance, not authorization or correctness.
  • Launch production jobs with a fixed script path, -NoProfile, -NonInteractive, a known working directory, and a least-privileged dedicated identity.

Define narrow parameters and authorization checks

  • Expose advanced functions with [CmdletBinding()],