Behind the PowerShell Pipeline logo

Behind the PowerShell Pipeline

Subscribe
Archives
February 17, 2022

Remote PowerShell Profiles

In the last article, I explained where PowerShell profile scripts come from and how to use them. There is, however, one area where you might make a wrong assumption about profiles. When you use PowerShell remoting to connect to a remote machine, you still connect to a PowerShell host. This host is called ServerRemoteHost and runs in a wsmprovhost process. For better or worse, this host is not configured to recognize or utilize profile scripts.

The $profile variable has no value in a remoting session. You might think that because you use roaming user profiles, your PowerShell profile script will follow you. That is not true.

Note: This behavior is also true when using PowerShell remoting over ssh in PowerShell 7. The PowerShell host name is still ServerRemoteHost, even though the session is hosted in a pwsh process.

Want to read the full issue?
GitHub Bluesky LinkedIn About Jeff
Powered by Buttondown, the easiest way to start and grow your newsletter.