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
When -PSVersion is specified, it should be respected. And all supported PSVersions (2.0 to 5.1) should be supported when the corresopnding version of Windows PowerShell is available.
Note that, when -PSEdition 2.0 is specified, Start-Job checks if PSv2 is installed using the method RemotingCommandUtil.CheckIfPowerShellVersionIsInstalled which will blindly throw exception in PSCore (see code below). If we want to support -PSEdition 2.0, then the #if CORECLR section of the method body should be removed.
internalstaticvoidCheckIfPowerShellVersionIsInstalled(Versionversion){// Check if PowerShell 2.0 is installedif(version!=null&&version.Major==2){
#if CORECLR// PowerShell 2.0 is not available for CoreCLRthrownewArgumentException(PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.PowerShellNotInstalled,version,"PSVersion"));
#else
// Because of app-compat issues, in Win8, we will have PS 2.0 installed by default but not .NET 2.0// In such a case, it is not enough if we check just PowerShell registry keys. We also need to check if .NET 2.0 is installed.
...
PS:2> Receive-Job $job
Major Minor Build Revision
----- ----- ----- --------
5 1 17134 81
Actual behavior
PS:2> Receive-Job $job
Major Minor Patch PreReleas BuildLabel
eLabel
----- ----- ----- --------- ----------
6 0 1
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
When
-PSVersionis specified, it should be respected. And all supported PSVersions (2.0 to 5.1) should be supported when the corresopnding version of Windows PowerShell is available.Note that, when
-PSEdition 2.0is specified,Start-Jobchecks if PSv2 is installed using the methodRemotingCommandUtil.CheckIfPowerShellVersionIsInstalledwhich will blindly throw exception in PSCore (see code below). If we want to support-PSEdition 2.0, then the#if CORECLRsection of the method body should be removed.Steps to reproduce
Expected behavior
Actual behavior
Environment data