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

Method getDefaultAzInstallFolder

lib/index.js:8448–8471  ·  view source on GitHub ↗
(os)

Source from the content-addressed store, hash-verified

8446 });
8447 }
8448 static getDefaultAzInstallFolder(os) {
8449 let defaultAzInstallFolder = "";
8450 switch (os) {
8451 case "linux":
8452 defaultAzInstallFolder = "/usr/share";
8453 break;
8454 case "windows":
8455 case "windows_nt":
8456 defaultAzInstallFolder = "C:\\Modules";
8457 break;
8458 case "macos":
8459 case "darwin":
8460 default:
8461 defaultAzInstallFolder = "";
8462 break;
8463 }
8464 if (Utils.isFolderExistAndWritable(defaultAzInstallFolder)) {
8465 return defaultAzInstallFolder;
8466 }
8467 if (Utils.isFolderExistAndWritable(process.env.RUNNER_TOOL_CACHE)) {
8468 return process.env.RUNNER_TOOL_CACHE;
8469 }
8470 return process.cwd();
8471 }
8472 static isFolderExistAndWritable(folderPath) {
8473 if (!folderPath) {
8474 return false;

Callers 2

constructorMethod · 0.45
setPSModulePathMethod · 0.45

Calls 1

Tested by

no test coverage detected