instalee/handlers/chocolatey/install
2022-09-08 19:25:02 +02:00

6 lines
No EOL
311 B
Bash
Executable file

#!/bin/sh
# https://stackoverflow.com/questions/43650595/is-there-a-command-to-check-if-git-bash-is-opened-in-administrator-mode/58846650#58846650
if [[ $(sfc 2>&1 | tr -d '\0') =~ SCANNOW ]]
then choco install "$@"
else exec powershell -Command "Start-Process 'choco' -Verb runAs -ArgumentList 'install $*'"
fi