cobra
cobra copied to clipboard
Make Powershell completion work in constrained mode
Currently the Powershell completion script generated by Cobra does not work in constrained mode because creating CompletionResult Objects is blocked there.
This adds a check to the script that returns results as plain strings if constrained mode is enabled. Results in FullLanguage mode are unchanged.
So far I've tested with Powershell 5.1 on Windows 10, all three completion modes seem to work as expected even in constrained mode.