How to run a remote bat file on a local computer

1

I need to run a batch file, that is stored on a server, locally on a windows 8.1 machine. I can run a shell script in OS X with a curl:

cURL "file path" | sh

is it possible to cURL in powershell in windows. What would go after the pipe what would interpret the .bat file?

liquidfoo

Posted 2015-08-31T14:03:21.700

Reputation: 11

Answers

0

Powershell has the Invoke-Expression cmdlet. You can download a powershell script and run it using:

Invoke-Expression ((new-object net.webclient).DownloadString('https://example.com/your_script.ps1'))

There are severall Powershell utilities that use this to simplify the install project (See Chocolatey)

heavyd

Posted 2015-08-31T14:03:21.700

Reputation: 54 755