Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Optimize module for "ConstrainedLanguage" #50

Open
hahazeMSFT opened this issue Jan 21, 2022 · 1 comment
Open

Optimize module for "ConstrainedLanguage" #50

hahazeMSFT opened this issue Jan 21, 2022 · 1 comment

Comments

@hahazeMSFT
Copy link

Currently can't import module in ConstrainedLanguage mode.

PS C:\WINDOWS\system32> $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage"
PS C:\WINDOWS\system32> Import-Module MSAL.PS -Verbose
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\MSAL.PS.psd1'.
VERBOSE: Populating RepositorySourceLocation property for module MSAL.PS.
Import-Module : Importing *.ps1 files as modules is not allowed in ConstrainedLanguage mode.
At line:1 char:1
+ Import-Module MSAL.PS -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Import-Module], InvalidOperationException
    + FullyQualifiedErrorId : Modules_ImportPSFileNotAllowedInConstrainedLanguage,Microsoft.PowerShell.Commands.Import
   ModuleCommand
@jazuntee
Copy link
Contributor

I think there are several reasons the module will not work in ConstrainedLanguage mode at the moment. I'll keep this open as something to investigate but it would like require significant rework, if it is even possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants