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

Method setPSModulePath

lib/index.js:8430–8447  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

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) {

Callers 2

importAzModuleMethod · 0.45
Utils.test.tsFile · 0.45

Calls 3

toStringMethod · 0.80

Tested by

no test coverage detected