PowerShell IntelliSense is for earlier versions of PowerShell

Newer versions of PowerShell ISE (and third-party PowerShell scripts such as PowerGUI) offer pretty good IntelliSense support.

However, I often write scripts that I want to run on servers that have only older versions of PowerShell installed (in particular, PowerShell 2.0 on Windows Server 2008 R2). I cannot upgrade the PowerShell installation on the server, and PowerShell 2.0 ISE does not have IntelliSense.

Is there a way to configure PowerShell 3.0 or 4.0 ISE or PowerGUI (or any other free PowerShell script editor!) To provide IntelliSense, which is limited only by PowerShell 2.0 compatible code?

+4
source share
1 answer

I reiterated Jason's theory that Intellisense actually works in PSRemoting against the installed version of Powershell, but it looks a bit different. I tested using Powershell preview build 5.0.10018.0 a remote Server 2008R2 server with PS v2.0. I ran:

$Procs = Get-Process
$Procs <Ctrl + Space>

As a result, an Intellisense tooltip appeared with options such as:

$Procs.count
$Procs.Clear(

Where v3.0 and up will include only the names of properties or methods, and not the variables themselves.

I also tested the magic methods Where () and .Foreach (), which did not appear in Intellisense. This seems to confirm that it works against the installed version.

+1
source

All Articles