Skip to content

$PSVersionTable.PSVersion throws error System.ArgumentOutOfRangeException,Microsoft.PowerShell.Commands.OutLineOutputCommand #6482

@adityapatwardhan

Description

@adityapatwardhan

$PSVersionTable.PSVersion.ToString() and $PSVersionTable still works.

The error can be reproduced on master branch.

Steps to reproduce

$PSVersionTable.PSVersion
out-lineoutput : Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
+ CategoryInfo          : NotSpecified: (:) [out-lineoutput], ArgumentOutOfRangeException
+ FullyQualifiedErrorId : System.ArgumentOutOfRangeException,Microsoft.PowerShell.Commands.OutLineOutputCommand

Expected behavior

Get the PSVersion string

Actual behavior

Error - System.ArgumentOutOfRangeException,Microsoft.PowerShell.Commands.OutLineOutputCommand


Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1-290-g942832c13a3c325851e9873bd25036775c85a18c
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

WG-Enginecore PowerShell engine, interpreter, and runtime

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions