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

Method saveAzModule

lib/index.js:8560–8572  ·  view source on GitHub ↗
(version, modulePath)

Source from the content-addressed store, hash-verified

8558 return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
8559 }
8560 static saveAzModule(version, modulePath) {
8561 return __awaiter(this, void 0, void 0, function* () {
8562 const script = `
8563 $prevProgressPref = $ProgressPreference
8564 $ProgressPreference = 'SilentlyContinue'
8565 Save-Module -Path ${modulePath} -Name Az -RequiredVersion ${version} -Force -ErrorAction Stop
8566 $ProgressPreference = $prevProgressPref`;
8567 const exitCode = yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(script);
8568 if (exitCode != 0) {
8569 throw new Error(`Download from PSGallery failed for Az ${version} to ${modulePath}`);
8570 }
8571 });
8572 }
8573}
8574exports["default"] = Utils;
8575

Callers 2

Utils.test.tsFile · 0.45

Calls 1

Tested by

no test coverage detected