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
On PowerShell 7.1 released just now, the Get-BTHistory and Remove-BTNotification functions no longer work.
Steps to reproduce
Get-BTHistory
Remove-BTNotification
Expected behavior
The Get-BTHistory function to return the toast notifications in the Action Center and the Remove-BTNotification function to remove toast notifications from the Action Center
Actual behavior
Both functions fail with the error:
Unable to cast object of type 'WinRT.IInspectable' to type 'Windows.UI.Notifications.ToastNotificationHistory'.
stemming from the “Windows.UI.Notifications.ToastNotificationManager” class that is included in the BurntToast module.
Environment data
[36] ► $PSVersionTable
Name Value
---- -----
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
ToastNotificationManager]::Hist …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to cast object of type 'WinRT.IInspectable' to type 'Windows.UI.Notifications.ToastNotificationHistory'.
I had installed PowerShell 7.1 from the Microsoft Store a couple of weeks back. When I ran New-BurntToastNotification nothing happened, no errors, no warnings and no notifications. Get-Command -Module BurntToast output listed the various BurntToast commands as you would expect,
Uninstalled PowerShell 7.1 and then re-installed using Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) } -UseMSI" and tried New-BurntToastNotification again. This time it worked OK so I guess either something was wrong with my Microsoft Store installed version of PowerShell or something is different between the installs from the Microsoft Store and the Invoke-Expression method.
Got the same behavior as noted above with Get-BTHistory and Remove-BTNotification (i.e. Unable to cast object error) with both the Microsoft Store and Invoke-Expression methods.
Just passing this on in case anyone else raises issues with running BurntToast against PowerShell 7.1 installed from the Microsoft Store.
On PowerShell 7.1 released just now, the Get-BTHistory and Remove-BTNotification functions no longer work.
Steps to reproduce
Get-BTHistory
Remove-BTNotification
Expected behavior
The Get-BTHistory function to return the toast notifications in the Action Center and the Remove-BTNotification function to remove toast notifications from the Action Center
Actual behavior
Both functions fail with the error:
Unable to cast object of type 'WinRT.IInspectable' to type 'Windows.UI.Notifications.ToastNotificationHistory'.
stemming from the “Windows.UI.Notifications.ToastNotificationManager” class that is included in the BurntToast module.
Environment data
The text was updated successfully, but these errors were encountered: