From 09ec3faf97f1105c1a74c87d2f2a4981fa5bb023 Mon Sep 17 00:00:00 2001 From: aksm-ms <58936966+aksm-ms@users.noreply.github.com> Date: Tue, 17 Mar 2020 09:46:10 +0530 Subject: [PATCH] changes in setmodulepath --- lib/PowerShell/Utilities/Utils.js | 14 +++++++------- src/PowerShell/Utilities/Utils.ts | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/PowerShell/Utilities/Utils.js b/lib/PowerShell/Utilities/Utils.js index 70dba97b..e32d79ae 100644 --- a/lib/PowerShell/Utilities/Utils.js +++ b/lib/PowerShell/Utilities/Utils.js @@ -50,17 +50,17 @@ class Utils { } static setPSModulePath(azPSVersion = "") { let modulePath = ""; - const RUNNER = process.env.RUNNER_OS || os.type(); - switch (RUNNER) { - case "Linux": + const runner = process.env.RUNNER_OS || os.type(); + switch (runner.toLowerCase()) { + case "linux": modulePath = `/usr/share/${azPSVersion}:`; break; - case "Windows": - case "Windows_NT": + case "windows": + case "windows_nt": modulePath = `C:\\Modules\\${azPSVersion};`; break; - case "macOS": - case "Darwin": + case "macos": + case "darwin": // TODO: add modulepath break; default: diff --git a/src/PowerShell/Utilities/Utils.ts b/src/PowerShell/Utilities/Utils.ts index 9d0efca3..9a25a72b 100644 --- a/src/PowerShell/Utilities/Utils.ts +++ b/src/PowerShell/Utilities/Utils.ts @@ -33,17 +33,17 @@ export default class Utils { static setPSModulePath(azPSVersion: string = "") { let modulePath: string = ""; - const RUNNER: string = process.env.RUNNER_OS || os.type(); - switch (RUNNER) { - case "Linux": + const runner: string = process.env.RUNNER_OS || os.type(); + switch (runner.toLowerCase()) { + case "linux": modulePath = `/usr/share/${azPSVersion}:`; break; - case "Windows": - case "Windows_NT": + case "windows": + case "windows_nt": modulePath = `C:\\Modules\\${azPSVersion};`; break; - case "macOS": - case "Darwin": + case "macos": + case "darwin": // TODO: add modulepath break; default: