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

Method saveAzModule

src/Utilities/Utils.ts:149–159  ·  view source on GitHub ↗
(version: string, modulePath: string)

Source from the content-addressed store, hash-verified

147 }
148
149 static async saveAzModule(version: string, modulePath: string): Promise<void> {
150 const script = `
151 $prevProgressPref = $ProgressPreference
152 $ProgressPreference = 'SilentlyContinue'
153 Save-Module -Path ${modulePath} -Name Az -RequiredVersion ${version} -Force -ErrorAction Stop
154 $ProgressPreference = $prevProgressPref`;
155 const exitCode = await PowerShellToolRunner.executePowerShellScriptBlock(script);
156 if (exitCode != 0) {
157 throw new Error(`Download from PSGallery failed for Az ${version} to ${modulePath}`);
158 }
159 }
160}

Callers 1

Calls 1

Tested by

no test coverage detected