Skip to content

Commit

Permalink
Merge pull request #19 from kevinmcox/2.6-Teams-Notifications
Browse files Browse the repository at this point in the history
2.6 - Teams Notifications
  • Loading branch information
pbowden-msft authored Jun 25, 2019
2 parents 13fc47f + 78e233e commit 1ec9af7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion MAUCacheAdmin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#set -x

TOOL_NAME="Microsoft AutoUpdate Cache Admin"
TOOL_VERSION="2.5"
TOOL_VERSION="2.6"

## Copyright (c) 2019 Microsoft Corp. All rights reserved.
## Scripts are not supported under any Microsoft standard support program or service. The scripts are provided AS IS without warranty of any kind.
Expand Down Expand Up @@ -47,6 +47,10 @@ SLACK_NOTIFY=false
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/<COMPLETE URL HERE>"
SLACK_ICON_URL="https://macadmins.software/icons/mau4.png"

# Variables for Microsoft Teams Notifications
TEAMS_NOTIFY=false
TEAMS_WEBHOOK_URL="https://outlook.office.com/webhook/<COMPLETE URL HERE>"

# Platform detection
PLATFORM=$(uname -s)

Expand Down Expand Up @@ -301,6 +305,14 @@ SlackNotify () {
fi
}

TeamsNotify () {
# Send Alert to Teams Webhook in Global Variable when Package is Downloaded
if [ $TEAMS_NOTIFY == true ]; then
echo "New Package Detected: $PACKAGE"
curl -H 'Content-type: application/json' -d '{"text":"New Package Downloaded: '"$PACKAGE"'"}' $TEAMS_WEBHOOK_URL
fi
}

DownloadPackage () {
# Downloads the specified update package
URL="$1"
Expand All @@ -309,6 +321,7 @@ DownloadPackage () {
PACKAGE=$(basename "$1")
HipChatNotify
SlackNotify
TeamsNotify
echo "==================================================="
echo Application: "$APPLICATION"
echo Package: "$PACKAGE"
Expand Down

0 comments on commit 1ec9af7

Please sign in to comment.