Skip to content

Commit 5d11aee

Browse files
stop supporting 6.0.0
1 parent 05f47a0 commit 5d11aee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

module/PowerShellEditorServices/Start-EditorServices.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ function WriteSessionFile($sessionInfo) {
142142
}
143143

144144
# Are we running in PowerShell 2 or earlier?
145-
if ($PSVersionTable.PSVersion.Major -le 2) {
145+
$version = $PSVersionTable.PSVersion
146+
if (($version.Major -le 2) -or ($version.Major -eq 6 -and $version.Minor -eq 0)) {
146147
# No ConvertTo-Json on PSv2 and below, so write out the JSON manually
147148
"{`"status`": `"failed`", `"reason`": `"unsupported`", `"powerShellVersion`": `"$($PSVersionTable.PSVersion.ToString())`"}" |
148149
Microsoft.PowerShell.Management\Set-Content -Force -Path "$SessionDetailsPath" -ErrorAction Stop

0 commit comments

Comments
 (0)