MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / runPowerShell

Function runPowerShell

scripts/ensure-win-codesign-cache.js:21–34  ·  view source on GitHub ↗
(script)

Source from the content-addressed store, hash-verified

19}
20
21function runPowerShell(script) {
22 const result = spawnSync(
23 'powershell',
24 ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', script],
25 { stdio: 'inherit' }
26 );
27 if (result.error) {
28 console.error(result.error);
29 process.exit(1);
30 }
31 if (result.status !== 0) {
32 process.exit(result.status ?? 1);
33 }
34}
35
36function main() {
37 if (process.platform !== 'win32') {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected