This is public repo for my collection of useful .cmd, .batch and .ps1 files for when Im in a windows enviroment.
A wget clone leveraging powershell to do the heavy lifting.
webget http://example.com/install.msi
Measure a commands execution time
timecmd <command>
##forfile
A shorthand for windows for
command when you need to run a command on every file in a directory. Expects the commands to accept the file as the last parameter of the command.
forfile <path> <comand>
Run all the sql scripts in a directory
forfile c:\scripts\*.sql sqlcmd -S myServer\instanceName -i
##Zip
Create a zip folder and add a number of files
zip <zipname> <file1> <file2> <file3>...
Aliases are injected into my console by running doskey /macrofile="path/to/aliasesfile
to automatically run this command I use the Autorun registry key found at HKEY_CURRENT_USER\Software\Microsoft\Command Processor
. See this blog post for more details.
Send me a pull request with the scripts you use.