-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Description
Or, a security configuration prevents the operation of a security tool.
On a Secure Admin Workstation or SAW that is configured to run Windows Powershell and/or PowerShell in a Constrained Language mode Microsoft.PowerShell.SecretStore errors.
PS5 C:\Users\user>$ExecutionContext.SessionState.LanguageMode
ConstrainedLanguage
PS5 C:\Users\User>Set-Secret -Name 'CORP/User' -Secret (Get-Credential -Credential 'CORP\User') -Vault SecretStoreWPS
Cannot invoke method. Method invocation is supported only on core types in this language mode.
At line:10 char:13
+ $module = Get-Module -Name ([System.IO.Path]::GetFileName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
Cannot use '&' or '.' operators to invoke a module scope command across language boundaries.
At line:18 char:13
+ & $module "$ImplementingModuleName\$Command" @Params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : CantInvokeCallOperatorAcrossLanguageBoundariesPS7 C:\Users\User>$ExecutionContext.SessionState.LanguageMode
ConstrainedLanguage
PS7 C:\Users\scsurber>Set-Secret -Name 'CORP/User' -Secret (Get-Credential -Credential 'CORP\User')
PowerShell credential request
Enter your credentials.
Password for user CORP\User: **********
InvalidOperation:
Line |
10 | $module = Get-Module -Name ([System.IO.Path]::GetFileName …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot invoke method. Method invocation is supported only on core types in this language mode.
InvalidOperation:
Line |
18 | & $module "$ImplementingModuleName\$Command" @Params
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot use '&' or '.' operators to invoke a module scope command across language boundaries.
Or we update documentation to specify Full Language mode required.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels