Run command for execution policy with -Command

This commit is contained in:
Sander Declerck 2026-02-05 10:05:26 +01:00
parent ff16530314
commit ad32a8d9be
No known key found for this signature in database

View file

@ -258,7 +258,7 @@ export function validatePowerShellExecutionPolicy(shellExecutableName) {
try { try {
// Security: Use literal command string, no interpolation // Security: Use literal command string, no interpolation
const policy = execSync("Get-ExecutionPolicy", { const policy = execSync('-Command "Get-ExecutionPolicy"', {
encoding: "utf8", encoding: "utf8",
shell: shellExecutableName, shell: shellExecutableName,
timeout: 5000, // 5 second timeout timeout: 5000, // 5 second timeout