(version: string, modulePath: string)
| 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 | } |
no test coverage detected