@@ -16,32 +16,36 @@ var __importStar = (this && this.__importStar) || function (mod) {
1616 return result ;
1717} ;
1818Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
19+ const os = __importStar ( require ( "os" ) ) ;
1920const core = __importStar ( require ( "@actions/core" ) ) ;
2021const exec = __importStar ( require ( "@actions/exec" ) ) ;
2122const io = __importStar ( require ( "@actions/io" ) ) ;
2223var psPath ;
2324exports . initializeAz = ( servicePrincipalId , servicePrincipalKey , tenantId , subscriptionId ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
2425 psPath = yield io . which ( "pwsh" , true ) ;
2526 setPSModulePath ( ) ;
26- setPSModulePath ( yield getLatestAzModule ( ) ) ;
27+ setPSModulePath ( yield getLatestModule ( ) ) ;
2728 yield loginToAzure ( servicePrincipalId , servicePrincipalKey , tenantId , subscriptionId ) ;
2829} ) ;
2930function setPSModulePath ( azPSVersion = "" ) {
3031 let modulePath = "" ;
31- switch ( process . env . RUNNER_OS ) {
32+ const RUNNER = process . env . RUNNER_OS || os . type ( ) ;
33+ switch ( RUNNER ) {
3234 case "Linux" :
3335 modulePath = `/usr/share/${ azPSVersion } :` ;
3436 break ;
3537 case "Windows" :
38+ case "Windows_NT" :
3639 modulePath = `C:\\Modules\\${ azPSVersion } ;` ;
3740 break ;
3841 case "macOS" :
42+ case "Darwin" :
3943 // TODO: add modulepath
4044 break ;
4145 }
4246 process . env . PSModulePath = `${ modulePath } ${ process . env . PSModulePath } ` ;
4347}
44- function getLatestAzModule ( ) {
48+ function getLatestModule ( ) {
4549 return __awaiter ( this , void 0 , void 0 , function * ( ) {
4650 const moduleName = "Az.Accounts" ;
4751 let output = "" ;
0 commit comments