
VS Code isn’t the same as ConsoleHost or ISE
Some features may not work the same. For example, the ISE doesn’t support
Write-Progress.Don’t use
$Host.Versionwhen you want$PSVersionTable.PSVersionNotice the version of the Host in the PowerShell Extension terminal of VS Code.
"$($Host.Name) version = $($Host.Version)" "PowerShell version = $($PSVersionTable.PSVersion)"Visual Studio Code Host version = 2024.3.2 PowerShell version = 7.4.5The
$Hostvariable can’t be replaced, so you can’t use it your scripts except to get Host information.