Category: Programming

Wrapping A PowerShell-Script Call In A Batchfile

Yet another opinion on this topic, YAY!

As I wasn’t satisfied with the most common solutions out there (first 5 google hits) – I’ve decided to create a .ps1->.bat wrapper on my own:

>> WrapPowerShellScript.bat on GitHub <<

Why did I create another version of the very same thing that should be well known already? – because I wanted to pass all arguments/parameters that are passed to the .bat-File to the wrapped PowerShell script:

Update: of course this also works with ‘BoundParameters’ 🙂


If you don’t like it – have a look at those alternatives:
* howtogeek – how-to-use-a-batch-file-to-make-powershell-scripts-easieto-run
* stackoverflow how-to-run-a-powershell-script-file-from-within-a-bat-file-and-pass-multiple-par