I have a case where I have some Powershell code to install software that is not supported to install over WinRM/PS Remoting. Is there a way I can check in the script whether it's currently executing in the context of a WinRM or PS Remoting 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.
- Are you trying to check being in the script which is getting executed remotely ?Prasoon Karunan V– Prasoon Karunan V2019-08-21 17:32:36 +00:00Commented Aug 21, 2019 at 17:32
- Yes, I want to write a check in the script to bail if it's being run over Powershell Remoting.codewario– codewario2019-08-21 17:43:53 +00:00Commented Aug 21, 2019 at 17:43
Add a comment |