This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM Rename this file to be the same name as your PowerShell .ps1 script. | |
REM This script must be in the same directory as your .ps1 script. | |
PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -Command ""& {%~dpn0.ps1;pause}""' -Verb RunAs}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
IF X%1==X GOTO INVALID_ARGS | |
IF X%2==X GOTO INVALID_ARGS | |
GOTO:RUN | |
:INVALID_ARGS | |
ECHO Invalid arguments | |
ECHO. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit # Fail and exit the script immediately if any command fails | |
set -o nounset # Throw an error if there are unset variables | |
# Parse arguments (based on https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash) | |
HARD="false" | |
VERBOSE="false" | |
usage_error () { echo >&2 "$(basename ${0}): ${1}"; exit 2; } | |
assert_argument () { test "${1}" != "${EOL}" || usage_error "${2} requires an argument"; } # TODO: Force boolean |
OlderNewer