Files
brew-testing/powershell.zsh
2022-04-07 10:30:14 +01:00

35 lines
1.5 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## PURPLE GITHUB PULL TEMPLATE ##
##   HomeBrew Install ##
##-------------------------------##
##-------------------------------##
## SET VARIABLES ##
LOGLOCAL=/Library/Logs/com.purplecomputing.mdm
##-------------------------------##
## PREFLIGHT SCRIPT ##
##-------------------------------##
# MAKE DIRECTORIES
mkdir -p /Library/Caches/com.purplecomputing.mdm
mkdir -p /Library/Caches/com.purplecomputing.mdm/Scripts/
# REMOVE APPS AND FILES
rm -rf /Library/Caches/com.purplecomputing.mdm/Scripts/InstallHomebrew.zsh
##-------------------------------##
## START SCRIPT ##
##-------------------------------##
# DOWNLOAD LATEST FILE
curl -o /Library/Caches/com.purplecomputing.mdm/Scripts/InstallHomebrew.zsh https://raw.githubusercontent.com/kandji-inc/support/main/Scripts/InstallHomebrew.zsh
# GIVE EXECUTE PERMISSIONS
chmod +x /Library/Caches/com.purplecomputing.mdm/Scripts/InstallHomebrew.zsh
cd /Applications
# RUN AS CURRENT USER
/Library/Caches/com.purplecomputing.mdm/Scripts/InstallHomebrew.zsh
sleep 3
##-------------------------------##
## POSTFLIGHT SCRIPT ##
##-------------------------------##
rm -rf /Library/Caches/com.purplecomputing.mdm/Scripts/InstallHomebrew.zsh
osascript -e 'tell app "Terminal"
do script "brew install --cask powershell && pwsh -Command Install-Module -Name ExchangeOnlineManagement -Confirm && pwsh -Command Install-Module -Name PSWSMan -Confirm"
end tell'
# END SCRIPT WITH SUCCESS
exit 0