Hide-UDToast Not Working

Product: PowerShell Universal
Version: 2.6.2

What am I doing wrong here? I cannot get Hide-UDToast to hide a toast message. Sample code:

New-UDButton -Text 'Click Me' -OnClick {
    $ID = '123'
    Show-UDToast -Id $ID -Message 'Testing...' -Persistent
    Start-Sleep -Seconds 5
    Hide-UDToast -Id $ID
}

Additionally, -ReplaceToast doesn’t appear to work, I’ll just get another message

Show-UDToast -Message 'Testing 2...' -Persistent -ReplaceToast

even tried using the same ID number

Show-UDToast -Id $ID -Message 'Testing 2...' -Persistent -ReplaceToast

Using Persistent or Duration doesn’t matter.

I think this may be a bug, I was able to replicate the issue by copy and pasting your code, but got it working if I changed the id from ‘123’ to ‘something1’. @adam - Adding for visibility

I’ve opened an issue to track here: Hide-UDToast does not work · Issue #845 · ironmansoftware/issues · GitHub

1 Like

I can confirm at least one letter at the beginning will work.

I originally came across this as the ID I was passing was a variable with a space and a period. Upon further testing I was able to determine the ID must start with a letter and only be alphanumeric characters.