MCPcopy
hub / github.com/claude-code-best/claude-code / tryPowerShellDownload

Function tryPowerShellDownload

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

Source from the content-addressed store, hash-verified

121}
122
123function tryPowerShellDownload(url, dest) {
124 const u = url.replace(/'/g, "''")
125 const d = dest.replace(/'/g, "''")
126 const cmd = `Invoke-WebRequest -Uri '${u}' -OutFile '${d}' -UseBasicParsing`
127 const result = spawnSync(
128 'powershell.exe',
129 [
130 '-NoProfile',
131 '-NonInteractive',
132 '-ExecutionPolicy',
133 'Bypass',
134 '-Command',
135 cmd,
136 ],
137 { stdio: 'pipe', windowsHide: true },
138 )
139 return result.status === 0 && existsSync(dest) && statSync(dest).size > 0
140}
141
142function tryCurlDownload(url, dest) {
143 const curl = process.platform === 'win32' ? 'curl.exe' : 'curl'

Callers 1

Calls 2

existsSyncFunction · 0.85
statSyncFunction · 0.85

Tested by

no test coverage detected