Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running in PowerShell constrained language mode #55

Open
camjjack opened this issue Jan 31, 2022 · 0 comments · May be fixed by #58
Open

Support running in PowerShell constrained language mode #55

camjjack opened this issue Jan 31, 2022 · 0 comments · May be fixed by #58

Comments

@camjjack
Copy link
Contributor

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

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.,
[IO.Path]::Combine(...

instead of
Join-Path ...

The other main issue is building XML documents .createElement et. al.

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.

Use Case(s)

Ability to use packer when administrators have enabled Powershell constrained language mode

Potential configuration

Potential References

https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/

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

Successfully merging a pull request may close this issue.

1 participant