Skip to content

Start-Job emits incorrect error message when specifying PowerShell version 2.0. #16062

Description

@PaulHigin

Prerequisites

Steps to reproduce

PS C:\> Start-Job -PSVersion 2.0 -ScriptBlock { $PSVersionTable } | Receive-Job -Wait

Starting a job with that runs in PowerShell version 2.0 is not supported. The current error message is misleading because it tells the user to first install PowerShell 2.0, even though it is unsupported whether it is installed or not.

Expected behavior

Start-Job: Cannot bind parameter 'PSVersion' to the target. Exception setting "PSVersion": "PowerShell version 2.0 is not supported."

Actual behavior

Start-Job: Cannot bind parameter 'PSVersion' to the target. Exception setting "PSVersion": "PowerShell 2.0 is not installed. Install PowerShell 2.0, and then try again."

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.9
PSEdition                      Core
GitCommitId                    7.2.0-preview.9-32-g17986d88c10eb6271b1aad2ca955889e45e2b285
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-RemotingPSRP issues with any transport layer

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions