Profile
You found one main difference, $profile not configured.
Buried at MSDN, here are some frequently asked questions about remote powershell or get-help about_Remote_FAQ .
In the section "WHERE IS MY PROFILES?" (heh) he explains:
For example, the following command launches the current CurrentUserCurrentHost profile from the local computer in a session in $ s.
invoke-command -session $s -filepath $profile
The following command launches the CurrentUserCurrentHost profile from a remote computer in a session in $ s. Since the variable $ profile is not populated, the command uses an explicit profile path.
invoke-command -session $s {. "$home\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"}
Serialization
Another difference that may affect you is that instead of .NET objects returned by commands that simply return directly when you start them remotely and return them, they become serialized and deserialized over the wire. Many objects support this tone, but some do not. Powershell automatically removes methods on objects that are no longer "connected", and then they are mainly data structures ... but they intercept methods for some types, such as DirectoryInfo .
Usually you do not need to worry about this, but if you return complex objects through a pipe, you can ...
Dan fitch
source share