PowerShell 7.4
Last reviewed Sep 5, 2026
Prompt Details
Prompt Composition
1prompt
- 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
FullLanguagemode 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
ConstrainedLanguageis 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 Bypassor automatically callUnblock-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-AuthenticodeSignatureresult 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()],