Using PowerShell 2, I can correctly use the $$
variable
PS > $PSVersionTable.PSVersion.Major
2
PS > Convert-Path 'Program Files'
C:\Program Files
PS > Convert-Path $$
C:\Program Files
However with PowerShell 4 the same command produces an error
PS > $PSVersionTable.PSVersion.Major
4
PS > Convert-Path 'Program Files'
C:\Program Files
PS > Convert-Path $$
Convert-Path : Cannot find path 'C:\'Program Files'' because it does not exist.
How can I use this example with PowerShell 4?