I want to run a power shell script which can run a exe file and following are my requirements. I have that exe file in a remote server location(//ES-WEBSRV01/DBMigration) which is shared to my local machine. Also I want to run that ps file through a cmd.exe.
1 Answer
You can simply call it like any other program:
\\ES-WEBSRV01\DBMigration\something.exe
or, if it contains spaces somewhere along the path:
& "\\ES-WEBSRV01\DBMigration\some thing.exe"
I have no clue what you mean by »Also I want to run that ps file through a cmd.exe.«, though. If you mean that you need a batch file and want to run the PowerShell script from there, then:
powershell -file myscript.ps1