JEA not exposing Import-PowerShellDataFile to module

Welcome Forums General PowerShell Q&A JEA not exposing Import-PowerShellDataFile to module

Viewing 0 reply threads
  • Author
    • #241553
      Topics: 2
      Replies: 1
      Points: 41
      Rank: Member

      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 = @('','othercustommodule')

        in Module Manifest results in

        OpenError: Cannot bind argument to parameter 'LiteralPath' because it is an empty array

        Trying each module separately shows 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

        in the root module now results in

        ObjectNotFound: 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 it’s calling Import-PowerShellDataFile to pull some data out of the manifest.  I tried adding to the JEA Module

        New-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?

Viewing 0 reply threads
  • You must be logged in to reply to this topic.