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

How to use Remove-BTNotification #83

Open
SkyLined opened this issue Dec 10, 2019 · 3 comments
Open

How to use Remove-BTNotification #83

SkyLined opened this issue Dec 10, 2019 · 3 comments
Assignees
Labels

Comments

@SkyLined
Copy link

It's not clear to me how to use Remove-BTNotification :

C:\Users\SkyLined>POWERSHELL New-BurntToastNotification -UniqueIdentifier 'ab' -Text 'test', 'bla'

C:\Users\SkyLined>POWERSHELL Remove-BTNotification -Tag 'ab'
Exception calling "Remove" with "2" argument(s): "Element not found. (Exception from HRESULT: 0x80070490)"
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.7.0\BurntToast.psm1:2061 char:9
+         [Windows.UI.Notifications.ToastNotificationManager]::History. ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Exception

This also does not work:

C:\Users\SkyLined>POWERSHELL Remove-BTNotification (New-BurntToastNotification -UniqueIdentifier 'ab' -Text 'test', 'bla2')
Exception calling "Clear" with "1" argument(s): "The parameter is incorrect.
applicationId"
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.7.0\BurntToast.psm1:2065 char:9
+         [Windows.UI.Notifications.ToastNotificationManager]::History. ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException

Also: the source refers to a help file does not exist.

@Windos
Copy link
Owner

Windos commented Dec 11, 2019

Looks like there's a bug when using the -Tag parameter on Remove-BTNotification... if you switch that over to -Group it should work as you're expecting, e.g.

New-BurntToastNotification -UniqueIdentifier 'ab' -Text 'test', 'bla'

Remove-BTNotification -Group 'ab'

Really sorry about the lack of online (and in a lot of cases comment based) help. That's one of the big things I need to get sorted for the next release (alongside fixing this issue!)

@Windos Windos self-assigned this Dec 11, 2019
@Windos Windos added the bug label Dec 11, 2019
@SkyLined
Copy link
Author

Thanks for the response. If I use -Group as in your example I no longer get an error but the toast message does not disappear as I would expect it to.

@SkyLined
Copy link
Author

Ignore that; I tried again and now it does disappear. This appears to be a good work-around for my issue.

@Windos Windos added docs and removed bug labels Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants