Skip to content

Enhancement Request: Ability to run vagrant in PowerShell constrained language mode #12685

Open
@camjjack

Description

@camjjack

Powershell constrained language mode. restricts access to sensitive language elements that can be used to invoke arbitrary Windows APIs. This plugin uses some elements that are blocked by constrained language mode.

Specifically this is often when we do something like invoking a .NET class rather than using inbuild powershell i.e.,

[System.Security.Principal.WindowsIdentity]::GetCurrent()
Cannot invoke method. Method invocation is supported only on core types in this language mode.
At line:1 char:1
+ [System.Security.Principal.WindowsIdentity]::GetCurrent()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage

Describe the solution you'd like
Ability to use vagrant when administrators have enabled Powershell constrained language mode.

Additional context
Constrained language mode can be set by setting the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment_PSLockDownPolicy to 4. Setting it back to 8 will return to FullLanguage mode.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions