(moduleName: string)
| 76 | } |
| 77 | |
| 78 | static async getLatestModule(moduleName: string): Promise<string> { |
| 79 | let output: string = ""; |
| 80 | const options: any = { |
| 81 | listeners: { |
| 82 | stdout: (data: Buffer) => { |
| 83 | output += data.toString(); |
| 84 | } |
| 85 | } |
| 86 | }; |
| 87 | await PowerShellToolRunner.executePowerShellScriptBlock(new ScriptBuilder() |
| 88 | .getLatestModuleScript(moduleName), options); |
| 89 | const outputJson = JSON.parse(output.trim()); |
| 90 | if (!(Constants.Success in outputJson)) { |
| 91 | throw new Error(outputJson[Constants.Error]); |
| 92 | } |
| 93 | const azLatestVersion: string = outputJson[Constants.AzVersion]; |
| 94 | if (!Utils.isValidVersion(azLatestVersion)) { |
| 95 | throw new Error(`Invalid AzPSVersion: ${azLatestVersion}`); |
| 96 | } |
| 97 | return azLatestVersion; |
| 98 | } |
| 99 | |
| 100 | static async checkModuleVersion(moduleName: string, version: string) { |
| 101 | let output: string = ""; |
no test coverage detected