System Frontier includes two special PowerShell script hosts out of the box, each of which defaults to their respective latest installed versions.
- PowerShell 7 (native)
- PowerShell 5 (native)
Because System Frontier executes PowerShell code using Runspaces, there are some key differences you’ll encounter as opposed to running in a normal shell. The following table shows some of the differences based on the script host being used.
|
Item |
Notes |
|---|---|
|
$PSScriptRoot |
Add the following snippet before any references to $PSScriptRoot to populate it with the SF automatic variable $SFScriptRoot.
|
|
$PSCommandPath |
Add the following snippet before any references to $PSCommandPath to populate it with the SF automatic variable $SFCommandPath.
|
|
$MyInvocation.PSCommandPath |
Not available. |
|
Clear-Host |
Not available. |
|
PSReadLine |
Not available. |