Invoke-HPNotificationFromXML

Summary

Triggers a toast notification from XML

Syntax

Invoke-HPNotificationFromXML [-Expiration <Int32>] [-TitleBarHeader <String>] [-TitleBarIcon <FileInfo>] -XmlPath <FileInfo> -ActionsJsonPath <FileInfo> [<CommonParameters>]

Invoke-HPNotificationFromXML [-Expiration <Int32>] [-TitleBarHeader <String>] [-TitleBarIcon <FileInfo>] -XmlPath <FileInfo> [-ActionsJson <String>] [<CommonParameters>]

Invoke-HPNotificationFromXML [-Expiration <Int32>] [-TitleBarHeader <String>] [-TitleBarIcon <FileInfo>] -Xml <String> -ActionsJsonPath <FileInfo> [<CommonParameters>]

Invoke-HPNotificationFromXML [-Expiration <Int32>] [-TitleBarHeader <String>] [-TitleBarIcon <FileInfo>] -Xml <String> [-ActionsJson <String>] [<CommonParameters>]

Description

This command triggers a toast notification from XML. Similar to the Invoke-HPNotification command, this command triggers toast notifications, but this command is more flexible and allows for more customization.

Parameters

Name Argument Description
Expiration <Int32> Specifies the life of the toast notification in minutes whether toast notification is on the screen or in the Action Center. If not specified, the invoked toast notification remains on screen until dismissed.
TitleBarHeader <String> Specifies the text of the toast notification in the title bar. If not specified, the text will default to "HP System Notification".
TitleBarIcon <FileInfo> Specifies the icon of the toast notification in the title bar. If not specified, the icon will default to the HP logo. Please note that the color of the icon might be inverted depending on the background color of the title bar.
Xml <String> Specifies the schema XML content of the toast notification. Please specify either Xml or XmlPath, but not both.
XmlPath <FileInfo> Specifies the file path to the schema XML content of the toast notification. Please specify either Xml or XmlPath, but not both.
ActionsJson <String> Specifies the actions that should be map the button id(s) (if any specified in XML) to the command(s) to call upon clicking the corresponding button. You can specify either ActionsJson or ActionsJsonPath, but not both.

Please note that button actions are registered in HKEY_CURRENT_USER in the registry. Button actions will persist until the user logs off.

Example to reboot the system upon clicking the button:
[
{
"id":"rebootnow",
"cmd":"C:\Windows\System32\shutdown.exe -r -t 0 -f"
}
]
ActionsJsonPath <FileInfo> Specifies the file path to the actions that should be map the button id(s) (if any specified in XML) to the command(s) to call upon clicking the corresponding button. You can specify either ActionsJson or ActionsJsonPath, but not both.

Please note that button actions are registered in HKEY_CURRENT_USER in the registry. Button actions will persist until the user logs off.

Examples


PS C:\> PS > Invoke-HPNotificationFromXML -XmlPath 'C:\path\to\schema.xml' -ActionsJsonPath 'C:\path\to\actions.json'

PS C:\> PS > Invoke-HPNotificationFromXML -XmlPath 'C:\path\to\schema.xml' -ActionsJson '[
PS C:\>  {
PS C:\>     "id":"rebootnow",
PS C:\>     "cmd":"C:\\Windows\\System32\\shutdown.exe -r -t 0 -f"
PS C:\>  }
PS C:\> ]'

PS C:\> PS > Invoke-HPNotificationFromXML -XmlPath 'C:\path\to\schema.xml'