Create powershell.zsh

This commit is contained in:
Michael
2022-04-07 10:30:14 +01:00
committed by GitHub
parent 1ad3de3a43
commit 0969fc5a3e

34
powershell.zsh Normal file
View File

@@ -0,0 +1,34 @@
## 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