diff --git a/src/System.Management.Automation/engine/Types_Ps1Xml.cs b/src/System.Management.Automation/engine/Types_Ps1Xml.cs index 15b32d1d312..0103c2df6ef 100644 --- a/src/System.Management.Automation/engine/Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/Types_Ps1Xml.cs @@ -1089,31 +1089,8 @@ public static IEnumerable Get() $ProgressPreference = 'SilentlyContinue' try { - if ($psversiontable.psversion.Major -lt 3) - { - # ok to cast CommandTypes enum to HelpCategory because string/identifier for - # cmdlet,function,filter,alias,externalscript is identical. - # it is ok to fail for other enum values (i.e. for Application) - $commandName = $this.Name - if ($this.ModuleName) - { - $commandName = ""{0}\{1}"" -f $this.ModuleName,$commandName - } - - $helpObject = get-help -Name $commandName -Category ([string]($this.CommandType)) -ErrorAction SilentlyContinue - - # return first non-null uri (and try not to hit any strict mode things) - if ($null -eq $helpObject) { return $null } - if ($null -eq $helpObject.psobject.properties['relatedLinks']) { return $null } - if ($null -eq $helpObject.relatedLinks.psobject.properties['navigationLink']) { return $null } - $helpUri = [string]$( $helpObject.relatedLinks.navigationLink | ForEach-Object { if ($null -ne $_.psobject.properties['uri']) { $_.uri } } | Where-Object { $_ } | Select-Object -first 1 ) - return $helpUri - } - else - { [Microsoft.PowerShell.Commands.GetHelpCodeMethods]::GetHelpUri($this) } - } catch {} finally { diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs index ba45255b755..e5f8688bae4 100644 --- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs +++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs @@ -943,11 +943,6 @@ public static Collection InvokeOnRunspace(PSCommand command, Runspace [string] $PSEditFunction ) - if ($PSVersionTable.PSVersion -lt ([version] '3.0')) - { - throw (new-object System.NotSupportedException) - } - Register-EngineEvent -SourceIdentifier PSISERemoteSessionOpenFile -Forward if ((Test-Path -Path 'function:\global:PSEdit') -eq $false) @@ -960,11 +955,6 @@ public static Collection InvokeOnRunspace(PSCommand command, Runspace /// RemovePSEditFunction script string. /// public const string RemovePSEditFunction = @" - if ($PSVersionTable.PSVersion -lt ([version] '3.0')) - { - throw (new-object System.NotSupportedException) - } - if ((Test-Path -Path 'function:\global:PSEdit') -eq $true) { Remove-Item -Path 'function:\global:PSEdit' -Force