You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{ Get-BTHistory-AppId 'Script Checker' } | Should -Throw "The AppId Script Checker is not present in the registry, please run New-BTAppId to avoid inconsistent Toast behaviour."
$Expected='What if: Performing the operation "Submit-BTNotification" on target "submitting: [ToastNotification] with AppId {1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe, Id , Sequence Number and XML: <?xml version="1.0" encoding="utf-8"?><toast><visual><binding template="ToastGeneric"><text>{Default Notification}</text><text placement="attribution">via Pester</text></binding></visual></toast>".'
163
+
$Expected='What if: Performing the operation "Submit-BTNotification" on target "submitting: [ToastNotification] with Id , Sequence Number and XML: <?xml version="1.0" encoding="utf-8"?><toast><visual><binding template="ToastGeneric"><text>{Default Notification}</text><text placement="attribution">via Pester</text></binding></visual></toast>".'
# Specifies the AppId of the 'application' or process that spawned the toast notification.
30
-
[string] $AppId=$Script:Config.AppId,
31
-
32
29
# A string that uniquely identifies a toast notification. Submitting a new toast with the same identifier as a previous toast will replace the previous toast.
33
30
#
34
31
# This is useful when updating the progress of a process, using a progress bar, or otherwise correcting/updating the information on a toast.
@@ -38,23 +35,19 @@ function Get-BTHistory {
38
35
[switch] $ScheduledToast
39
36
)
40
37
41
-
if (!(Test-Path-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\$AppId")) {
42
-
throw"The AppId $AppId is not present in the registry, please run New-BTAppId to avoid inconsistent Toast behaviour."
38
+
if ($Script:ActionsSupported) {
39
+
Write-Warning-Message 'The output from this function in some versions of PowerShell is not useful. Unfortunately this is expected at this time.'
Copy file name to clipboardexpand all lines: src/Public/Submit-BTNotification.ps1
+1-8
Original file line number
Diff line number
Diff line change
@@ -37,9 +37,6 @@
37
37
# This is useful when updating the progress of a process, using a progress bar, or otherwise correcting/updating the information on a toast.
38
38
[string] $UniqueIdentifier,
39
39
40
-
# Specifies the AppId of the 'application' or process that spawned the toast notification.
41
-
[string] $AppId=$Script:Config.AppId,
42
-
43
40
# A hashtable that binds strings to keys in a toast notification. In order to update a toast, the original toast needs to include a databinding hashtable.
44
41
[hashtable] $DataBinding,
45
42
@@ -56,10 +53,6 @@
56
53
[scriptblock] $FailedAction
57
54
)
58
55
59
-
if (!(Test-Path-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\$AppId")) {
60
-
Write-Warning-Message "The AppId $AppId is not present in the registry, please run New-BTAppId to avoid inconsistent Toast behaviour."
if($PSCmdlet.ShouldProcess( "submitting: [$($Toast.GetType().Name)] with AppId $AppId, Id $UniqueIdentifier, Sequence Number $($Toast.Data.SequenceNumber) and XML: $($Content.GetContent())")) {
162
+
if($PSCmdlet.ShouldProcess( "submitting: [$($Toast.GetType().Name)] with Id $UniqueIdentifier, Sequence Number $($Toast.Data.SequenceNumber) and XML: $($Content.GetContent())")) {
Copy file name to clipboardexpand all lines: src/Public/Update-BTNotification.ps1
+2-9
Original file line number
Diff line number
Diff line change
@@ -44,17 +44,10 @@
44
44
# This is useful when updating the progress of a process, using a progress bar, or otherwise correcting/updating the information on a toast.
45
45
[string] $UniqueIdentifier,
46
46
47
-
# Specifies the AppId of the 'application' or process that spawned the toast notification.
48
-
[string] $AppId=$Script:Config.AppId,
49
-
50
47
# A hashtable that binds strings to keys in a toast notification. In order to update a toast, the original toast needs to include a databinding hashtable.
51
48
[hashtable] $DataBinding
52
49
)
53
50
54
-
if (!(Test-Path-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\$AppId")) {
55
-
Write-Warning-Message "The AppId $AppId is not present in the registry, please run New-BTAppId to avoid inconsistent Toast behaviour."
0 commit comments