GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — Fix for implicit remote regression in restricted session by PaulHigin · Pull Request #4222 · PowerShell/PowerShell Conversation
Contributor
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:# Create and register a restricted session endpoint on local machine with PS 5.1 New-PSSessionConfigurationFile -Path c:\restricted.pssc -SessionType RestrictedRemoteServer Register-PSSessionConfiguration -Path C:\restricted.pssc -Name restricted -Force # Create and import a session instance $s = New-PSSession -config restricted Import-PSSession -Session $s -AllowClobber Result: Import-PSSession : Running the Get-Command command in a remote session reported the following error: A parameter cannot be found that matches parameter name 'PowerShellVersion'.. At line:1 char:1 + Import-PSSession -Session $s -AllowClobber + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidResult: (:) [Import-PSSession], RuntimeException + FullyQualifiedErrorId : ErrorFromRemoteCommand,Microsoft.PowerShell.Commands.ImportPSSessionCommand
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Travis Plunk (TravisEz13)
approved these changes
|
There was an error while loading. Please reload this page.
|
Paul Higinbotham (@PaulHigin) we have implicit remoting tests at https://github.com/PowerShell/PowerShell/blob/master/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) Thanks!, I didn't realize these tests were ported. I'll create a test for this fix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| if ($originalDefaultParameters -ne $null) | ||
| { | ||
| $PSDefaultParameterValues = $originalDefaultParameters |
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
restarted AppVeyor CI due to MyGet failure |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.