You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using Enter-PSSession -ContainerId is hardcoded to powershell.exe #6669
The proposal would be to add a switch DoNotUseWindowsPowerShell to be able to use PowerShell Core. I know, the naming does not sound good (double negative, etc), but such a switch parameter is more useful as existing scripts can't be broken by changing the default and having to incorporate the word PowerShell Core in a ValidateSet is also not good if it gets renamed back to just PowerShell in the future. I am happy to take any suggestions
That sounds interesting! In the scenario of using winrm and having both PowerShell installed in Windows. I would see it practical to have a switch to pick which PowerShell to use.
Also, as far as I see, the same parameter would need to be added to at least the Invoke-Command, New-PSSession, Remove-PSSession and Get-PSSession cmdlets as well.
I have a rough prototype that should (have not tested it yet) work here. Expect a PR in the next week(s).
Activity
bergmeister commentedon Jul 4, 2018
The current cmdlet syntax is:
The proposal would be to add a switch
DoNotUseWindowsPowerShellto be able to use PowerShell Core. I know, the naming does not sound good (double negative, etc), but such a switch parameter is more useful as existing scripts can't be broken by changing the default and having to incorporate the wordPowerShell Corein a ValidateSet is also not good if it gets renamed back to justPowerShellin the future. I am happy to take any suggestionsMaximoTrinidad commentedon Jul 5, 2018
+1
That sounds interesting! In the scenario of using winrm and having both PowerShell installed in Windows. I would see it practical to have a switch to pick which PowerShell to use.
:)
bergmeister commentedon Jul 5, 2018
Also, as far as I see, the same parameter would need to be added to at least the
Invoke-Command,New-PSSession,Remove-PSSessionandGet-PSSessioncmdlets as well.I have a rough prototype that should (have not tested it yet) work here. Expect a PR in the next week(s).
SteveL-MSFT commentedon Mar 29, 2019
Closing this since #7241 provides a good enough solution