title: Is there a way to check if the current Powershell script is being executed over a WinRM/PS Remoting session?
body: <p>I have a case where I have some Powershell code to install software that is not supported to install over <code>WinRM</code>/<code>PS Remoting</code>. Is there a way I can check in the script whether it's currently executing in the context of a <code>WinRM</code> or <code>PS Remoting</code> session? I'm aware of how to check if a returned object came from a remote execution, but not how to check whether the current context is remote or not.</p>