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

Method getLatestModule

lib/index.js:8490–8512  ·  view source on GitHub ↗
(moduleName)

Source from the content-addressed store, hash-verified

8488 return true;
8489 }
8490 static getLatestModule(moduleName) {
8491 return __awaiter(this, void 0, void 0, function* () {
8492 let output = "";
8493 const options = {
8494 listeners: {
8495 stdout: (data) => {
8496 output += data.toString();
8497 }
8498 }
8499 };
8500 yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(new ScriptBuilder_1.default()
8501 .getLatestModuleScript(moduleName), options);
8502 const outputJson = JSON.parse(output.trim());
8503 if (!(Constants_1.default.Success in outputJson)) {
8504 throw new Error(outputJson[Constants_1.default.Error]);
8505 }
8506 const azLatestVersion = outputJson[Constants_1.default.AzVersion];
8507 if (!Utils.isValidVersion(azLatestVersion)) {
8508 throw new Error(`Invalid AzPSVersion: ${azLatestVersion}`);
8509 }
8510 return azLatestVersion;
8511 });
8512 }
8513 static checkModuleVersion(moduleName, version) {
8514 return __awaiter(this, void 0, void 0, function* () {
8515 let output = "";

Callers 2

importAzModuleMethod · 0.45
Utils.test.tsFile · 0.45

Calls 4

toStringMethod · 0.80
getLatestModuleScriptMethod · 0.45
isValidVersionMethod · 0.45

Tested by

no test coverage detected