MCPcopy Create free account
hub / github.com/Azure/powershell / unzipUsingPowerShell

Method unzipUsingPowerShell

lib/index.js:8088–8101  ·  view source on GitHub ↗
(zipPath, destination)

Source from the content-addressed store, hash-verified

8086 });
8087 }
8088 unzipUsingPowerShell(zipPath, destination) {
8089 return __awaiter(this, void 0, void 0, function* () {
8090 (0, core_1.debug)(`Using powershell Expand-Archive cmdlet to extract ${zipPath} to ${destination}`);
8091 const script = `
8092 $prevProgressPref = $ProgressPreference
8093 $ProgressPreference = 'SilentlyContinue'
8094 Expand-Archive -Path ${zipPath} -DestinationPath ${destination}
8095 $ProgressPreference = $prevProgressPref`;
8096 const exitCode = yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(script);
8097 if (exitCode != 0) {
8098 throw new Error(`Extraction using Expand-Archive cmdlet failed from ${zipPath} to ${destination}`);
8099 }
8100 });
8101 }
8102}
8103exports.ArchiveTools = ArchiveTools;
8104

Callers 1

unzipMethod · 0.95

Calls 1

Tested by

no test coverage detected