PS: Create Batch Launcher Files

Description:

So in the past I wrote about a way to call PS1 files with Batch files to bypass Executionpolicy and run scripts as admin, if you have not seen that post – it is here. What this script does is create a batch file for each of my script automatically.
This script works great if you have a module, but you want to run each of your scripts in your “public” folder one by one for whatever reason. One major note about using this script though is you will have to MANUALLY UNCOMMENT THE FUNCTION CALL AT THE END OF EACH SCRIPT.

So the use case would be something like this:

  1. Run this script against your ModuleNamel\Public\*.ps1 files which will then create a batch file to launch each of your scripts.
  2. Go to the scripts you want to run as a script and open it up and remove the comment from the third line to the last line in the file (usually).

To Resolve:

1. Creates batch files for each powershell script in a directory.

This can be found in my gwFileSystem section.