Profile Execution
PowerShell Server will use the host-agnostic profile scripts (e.g. profile.ps1) and Server-specific named profiles that are only run for PowerShell Server connections. You can also see what host you're running in (PowerShell Server or regular PowerShell) by checking the value of $NSShellId.
Name | Description |
nsoftware.PowerShell_profile.ps1 | Used only for interactive sessions. |
nsoftware.PSExec_profile.ps1 | Used for only for exec and PowerShell Server cmdlet connections. |
Profiles will first be loaded from the "%SystemRoot%\System32\WindowsPowerShell\v1.0" location and then the "%UserProfile%\Documents\WindowsPowerShell" location.