-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix for implicit remote regression in restricted session #4222
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
Conversation
There is no test associated with this fix because we have not ported implicit remoting tests yet. |
@PaulHigin we have implicit remoting tests at https://github.com/PowerShell/PowerShell/blob/master/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 |
@daxian-dbw Thanks!, I didn't realize these tests were ported. I'll create a test for this fix. |
|
||
if ($originalDefaultParameters -ne $null) | ||
{ | ||
$PSDefaultParameterValues = $originalDefaultParameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be $global:PSDefaultParameterValues = $originalDefaultParameters
. Otherwise, you are just defining a variable in the local scope.
restarted AppVeyor CI due to MyGet failure |
Issue #4195
PowerShell 5.1 Get-FormatData has a new required parameter (PowerShellVersion) which was not included in restricted sessions. So Import-PSSession fails when trying to use the parameter.
Fix is to add this parameter to the restricted session Get-FormatData proxy function.
Repro: