Welcome › Forums › General PowerShell Q&A › JEA not exposing Import-PowerShellDataFile to module
- This topic has 0 replies, 1 voice, and was last updated 6 months, 1 week ago by
Mark Domansky.
-
AuthorPosts
-
-
July 10, 2020 at 10:51 am #241553
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:
-
PowerShell1requiredmodules = @('msal.ps','othercustommodule')
in Module Manifest results in
PowerShell1OpenError: Cannot bind argument to parameter 'LiteralPath' because it is an empty arrayTrying 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).
-
PowerShell1import-module msal.ps
in the root module now results in
PowerShell1ObjectNotFound: 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 Module
PowerShell1New-Alias -name Import-PowerShellDataFile -value Microsoft.PowerShell.Utility\Import-PowerShellDataFile -scope globallike 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?
-
-
-
AuthorPosts
- The topic ‘JEA not exposing Import-PowerShellDataFile to module’ is closed to new replies.