I have found the answer here:

[HERE][1]


I hope this helps someone who needs this.

 [1]: https://stackoverflow.com/questions/56497393/how-to-execute-powershell-script-from-server1-for-deploying-wsp-in-server2