MCPcopy Create free account
hub / github.com/claude-code-internals/claude-code-runnable / tryPowerShellDownload

Function tryPowerShellDownload

scripts/postinstall.cjs:66–72  ·  view source on GitHub ↗
(url, dest)

Source from the content-addressed store, hash-verified

64}
65
66function tryPowerShellDownload(url, dest) {
67 const u = url.replace(/'/g, "''")
68 const d = dest.replace(/'/g, "''")
69 const cmd = `Invoke-WebRequest -Uri '${u}' -OutFile '${d}' -UseBasicParsing`
70 const result = spawnSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', cmd], { stdio: 'pipe', windowsHide: true })
71 return result.status === 0 && existsSync(dest) && statSync(dest).size > 0
72}
73
74function tryCurlDownload(url, dest) {
75 const curl = process.platform === 'win32' ? 'curl.exe' : 'curl'

Callers 1

Calls 2

existsSyncFunction · 0.85
statSyncFunction · 0.85

Tested by

no test coverage detected