You could potentially use the Win32-Process WMI class, but keep in mind that the "designed" solution for this is Remoting. PowerShell doesn't natively provide an alternative, although as I mentioned you could possibly use WMI.
The major draw back to using this approach is getting the data back.
You are creating a new PowerShell process and your script will run in the context of that process. PowerShell doesn't allow for data being moved across instances. You could get you script to write output to a location you can access but that is starting to build in a lot of complications to avoid using remoting
I did think of trying to use a CIM session but you still run into the issue of opening a separate PowerShell session from which you can't return the data
Remoting is designed specifically for this scenario and is the recommended way to approach this type of problem
The topic ‘Launch a ps1 script on a remote machine without psremoting enabled, but using PS’ is closed to new replies.