masterzen / winrm

Command-line tool and library for Windows remote command execution in Go
Apache License 2.0
425 stars 129 forks source link

[Question] Execute function from local script in the remote host. #135

Open Corbent opened 1 year ago

Corbent commented 1 year ago

Greetings. Didn't know where to ask.

Let's say I have a ps1 script locally, and I need to run a function on the remote host.

Does this library provide a way to run said function in the remote in a way similar to how "Invoke-Command -ComputerName ServerName -FilePath c:\Scripts\scriptname.ps1" would in powershell?

Or do I need to copy the script into the host first, then use RunPSWithContextWithString to run it?