Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6 - Teams Notifications #19

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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