I’m working on a JEA script that requires importing MSAL.PS.
The JEA configuration is set to use a gMSA, and SessionType=RestrictedRemoteServer.
As part of the JEA Module, I’ve been through the following:
-
requiredmodules = @('msal.ps','othercustommodule')in Module Manifest results inOpenError: Cannot bind argument to parameter 'LiteralPath' because it is an empty array
Trying each module separately shows msal.ps generating the error, the other one is fine. Both follow c\prog\winps\modules\<name>\<ver>\<name.psd1> and work fine outside JEA with the gMSA (so not a $env:psmodulepath issue). -
import-module msal.ps
in the root module now results inObjectNotFound: The term 'Microsoft.PowerShell.Utility\Import-PowerShellDataFile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Looking into msal.ps it's calling Import-PowerShellDataFile to pull some data out of the manifest. I tried adding to the JEA ModuleNew-Alias -name Import-PowerShellDataFile -value Microsoft.PowerShell.Utility\Import-PowerShellDataFile -scope global
like is required to use all parameters of Select-Object. I can now get-command and see the alias, but it doesn't change the error, implying the module still can't see it. I also tried scope script, with no improvement.
Any other ideas?