* Add the folder path where Az modules are present to PSModulePath based on runner * @param azPSVersion * If azPSVersion is empty, folder path in which all Az modules are present are set * If azPSVersion is not empty, folder path of exact Az module version is set
()
| 8428 | * If azPSVersion is not empty, folder path of exact Az module version is set |
| 8429 | */ |
| 8430 | static setPSModulePath() { |
| 8431 | return __awaiter(this, arguments, void 0, function* (azPSVersion = "") { |
| 8432 | let output = ""; |
| 8433 | const options = { |
| 8434 | listeners: { |
| 8435 | stdout: (data) => { |
| 8436 | output += data.toString(); |
| 8437 | } |
| 8438 | } |
| 8439 | }; |
| 8440 | yield PowerShellToolRunner_1.default.executePowerShellScriptBlock("$env:PSModulePath", options); |
| 8441 | const defaultPSModulePath = output.trim(); |
| 8442 | const runner = process.env.RUNNER_OS || os.type(); |
| 8443 | let defaultAzInstallFolder = Utils.getDefaultAzInstallFolder(runner.toLowerCase()); |
| 8444 | let modulePath = path_1.default.join(defaultAzInstallFolder, `${azPSVersion}`); |
| 8445 | process.env.PSModulePath = `${modulePath}${path_1.default.delimiter}${defaultPSModulePath}`; |
| 8446 | }); |
| 8447 | } |
| 8448 | static getDefaultAzInstallFolder(os) { |
| 8449 | let defaultAzInstallFolder = ""; |
| 8450 | switch (os) { |
no test coverage detected