Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Displays a Windows 10 toast notification in conjunction with Application deployments in ConfigMgr
## Displays a Windows 10 Toast Notification for a ConfigMgr Application deployment
## To be used in a compliance item
## References
# Options for audio: https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audio#attributes-and-elements
# Toast content schema: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/toast-schema
# Datetime format for deadline: Ref: https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx
# Required parameters
$Title = "Enterprise Vault Outlook Add-in"
$SoftwarecenterShortcut= "softwarecenter:SoftwareID=ScopeId_8E25450A-4C7E-4508-B501-B3F0E2C91541/Application_abd1dcbe-275a-4be1-9800-1c1e9a0ce7ff"
$AudioSource = "ms-winsoundevent:Notification.Default"
$SubtitleText = "A new version of the Enterprise Vault Outlook Add-in is now available."
$BodyText = "The add-in provides email archiving functionality. This update is necessary for compatibility with Office 365. Please close Outlook before updating."
$HeaderFormat = "ImageOnly" # Choose from "TitleOnly", "ImageOnly" or "ImageAndTitle"
# Optional parameters
# Base64 string for an image, see Images section below to create the string
$Base64Image = "iVBORw0KGgoAAAANSUhEUgAAAREAAABKCAYAAACcqmAOAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAAEnMAABJzAYwiuQcAACtiSURBVHhe7d2Ht1fVtS/w9w+88e54477xys1NNAkWsLcYO/auKfYYu8aYaow9xppYYozpsSRGY4lGBAELqNgoNlAUS1QQK1IsFEEF1lufec46bn7+zuF3Cke52XOMNX5lr7r3mt8151xzzf3fUk011VRTL6gGkZpqqqlXVINITTXV1CuqQaSmmmrqFdUgUlNNNfWKahCpqaaaekWfChBZunhx+nDevLRw5qy04NXX0ryp09Lcfz6f3n32uZyejeT3vKlT04JXXk2Lcr4Pcn7laqqppk+WPhkQWbo0LXn//bRo1qw078Wpac5jE9O0665PT5x5dppw5DFpzK57pjs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kaXVOfEZ2aDs4ewQ+ianup6V+b+hVEOijPvSXvf5C8y4bKMefRiaHueN+LF0d5zYRXWQIJTmY+79x863gD34Qjj0lP5HwO8/EdUV7YxnI+p6aaaupf+mRApIF4nFJ3gMqCV14NG4oo8dSStvRc/CbBxPZvzheOaivQ4lxTTTW1Rp8KEKmppppWXqpBpKaaauoV1SBSU0019YpqEKmpppp6RTWI1FRTTb2iGkRqqqmmXlENIjXVVFOvqAaRmmqqqReU0v8Hu8AVxuUl8eEAAAAASUVORK5CYII="
# Deployment deadline
#[datetime]$Deadline = "21 June 2018 15:00"
# Calculated parameters
If ($Deadline)
{
$TimeSpan = $Deadline - [datetime]::Now
}
## Images
# Convert an image file to base64 string
<#
$File = "C:\Users\tjones\Pictures\ICON_EV_LOGO_Resized.png"
$Image = [System.Drawing.Image]::FromFile($File)
$MemoryStream = New-Object System.IO.MemoryStream
$Image.Save($MemoryStream, $Image.RawFormat)
[System.Byte[]]$Bytes = $MemoryStream.ToArray()
$Base64 = [System.Convert]::ToBase64String($Bytes)
$Image.Dispose()
$MemoryStream.Dispose()
$Base64 | out-file "C:\Users\tjones\Pictures\ICON_EV_LOGO_Resized.txt" # Save to text file, copy and paste from there to the $Base64Image variable
#>
# Create an image file from base64 string and save to user temp location
If ($Base64Image)
{
$ImageFile = "$env:TEMP\ToastLogo.png"
[byte[]]$Bytes = [convert]::FromBase64String($Base64Image)
[System.IO.File]::WriteAllBytes($ImageFile,$Bytes)
}
# Load some required namespaces
$null = [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]
$null = [Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]
# Register the AppID in the registry for use with the Action Center, if required
$app = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe'
$AppID = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WindowsPowerShell\\v1.0\\powershell.exe"
$RegPath = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings'
if (!(Test-Path -Path "$RegPath\$AppId")) {
$null = New-Item -Path "$RegPath\$AppId" -Force
$null = New-ItemProperty -Path "$RegPath\$AppId" -Name 'ShowInActionCenter' -Value 1 -PropertyType 'DWORD'
}
# Define the toast notification in XML format
[xml]$ToastTemplate = @"
<toast scenario="reminder">
<visual>
<binding template="ToastGeneric">
<text>New Software Notification</text>
<text placement="attribution">from Contoso IT</text>
<group>
<subgroup>
<text hint-style="title" hint-wrap="true" >$Title</text>
</subgroup>
</group>
<group>
<subgroup>
<text hint-style="subtitle" hint-wrap="true" >$SubtitleText</text>
</subgroup>
</group>
<group>
<subgroup>
<text hint-style="body" hint-wrap="true" >$BodyText</text>
</subgroup>
</group>
</binding>
</visual>
<actions>
<action content="Install now" activationType="protocol" arguments="$SoftwarecenterShortcut" />
<action content="Another time..." arguments="" />
</actions>
<audio src="$AudioSource"/>
</toast>
"@
# Change up the headers as required
If ($HeaderFormat -eq "TitleOnly")
{
$ToastTemplate.toast.visual.binding.group[0].subgroup.InnerXml = "<text hint-style=""title"" hint-wrap=""true"" >$Title</text>"
}
If ($HeaderFormat -eq "ImageOnly")
{
$ToastTemplate.toast.visual.binding.group[0].subgroup.InnerXml = "<image src=""$ImageFile""/>"
}
If ($HeaderFormat -eq "ImageAndTitle")
{
$ToastTemplate.toast.visual.binding.group[0].subgroup.InnerXml = "<text hint-style=""title"" hint-wrap=""true"" >$Title</text><image src=""$ImageFile""/>"
}
# Add a deadline if required
If ($Deadline)
{
$DeadlineGroups = @"
<group>
<subgroup>
<text hint-style="base" hint-align="left">Deadline</text>
<text hint-style="caption" hint-align="left">$(Get-Date -Date $Deadline -Format "dd MMMM yyy HH:mm")</text>
</subgroup>
<subgroup>
<text hint-style="base" hint-align="right">Time Remaining .</text>
<text hint-style="caption" hint-align="right">$($TimeSpan.Days) days $($TimeSpan.Hours) hours $($TimeSpan.Minutes) minutes .</text>
</subgroup>
</group>
"@
$ToastTemplate.toast.visual.binding.InnerXml = $ToastTemplate.toast.visual.binding.InnerXml + $DeadlineGroups
}
# Load the notification into the required format
$ToastXml = New-Object -TypeName Windows.Data.Xml.Dom.XmlDocument
$ToastXml.LoadXml($ToastTemplate.OuterXml)
# Display
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($app).Show($ToastXml)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.