mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix linting
This commit is contained in:
parent
13f2ae6e22
commit
0dfa151b02
1 changed files with 8 additions and 5 deletions
|
|
@ -258,11 +258,10 @@ export async function validatePowerShellExecutionPolicy(shellExecutableName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const spawnOptions = {};
|
|
||||||
|
|
||||||
// For Windows PowerShell (5.1), clean PSModulePath to avoid conflicts with PowerShell 7 modules
|
// For Windows PowerShell (5.1), clean PSModulePath to avoid conflicts with PowerShell 7 modules
|
||||||
// When PowerShell 7 is installed, it adds its module paths to PSModulePath, causing
|
// When PowerShell 7 is installed, it adds its module paths to PSModulePath, causing
|
||||||
// Windows PowerShell to try loading incompatible PowerShell 7 modules (TypeData conflicts)
|
// Windows PowerShell to try loading incompatible PowerShell 7 modules (TypeData conflicts)
|
||||||
|
let spawnOptions;
|
||||||
if (shellExecutableName === "powershell") {
|
if (shellExecutableName === "powershell") {
|
||||||
const userProfile = process.env.USERPROFILE || "";
|
const userProfile = process.env.USERPROFILE || "";
|
||||||
const cleanPSModulePath = [
|
const cleanPSModulePath = [
|
||||||
|
|
@ -271,10 +270,14 @@ export async function validatePowerShellExecutionPolicy(shellExecutableName) {
|
||||||
"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules",
|
"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules",
|
||||||
].join(";");
|
].join(";");
|
||||||
|
|
||||||
spawnOptions.env = {
|
spawnOptions = {
|
||||||
...process.env,
|
env: {
|
||||||
PSModulePath: cleanPSModulePath,
|
...process.env,
|
||||||
|
PSModulePath: cleanPSModulePath,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
spawnOptions = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const commandResult = await safeSpawn(
|
const commandResult = await safeSpawn(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue