| 8319 | this.script = ""; |
| 8320 | } |
| 8321 | getLatestModuleScript(moduleName) { |
| 8322 | const command = `Get-Module -Name ${moduleName} -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1`; |
| 8323 | this.script += `try { |
| 8324 | $ErrorActionPreference = "Stop" |
| 8325 | $WarningPreference = "SilentlyContinue" |
| 8326 | $output = @{} |
| 8327 | $data = ${command} |
| 8328 | $output['${Constants_1.default.AzVersion}'] = $data.Version.ToString() |
| 8329 | $output['${Constants_1.default.Success}'] = "true" |
| 8330 | } |
| 8331 | catch { |
| 8332 | $output['${Constants_1.default.Error}'] = $_.exception.Message |
| 8333 | } |
| 8334 | return ConvertTo-Json $output`; |
| 8335 | core.debug(`GetLatestModuleScript: ${this.script}`); |
| 8336 | return this.script; |
| 8337 | } |
| 8338 | checkModuleVersionScript(moduleName, version) { |
| 8339 | const command = `Get-Module -Name ${moduleName} -ListAvailable | Where-Object Version -match ${version}`; |
| 8340 | this.script += `try { |