Giter Club home page Giter Club logo

burnttoast's Introduction

BurntToast

Codacy Badge codecov Build Status PowerShell Gallery Version PowerShell Gallery Downloads Open Issues

BurntToast Logo Banner

PowerShell Module for displaying Windows 10 and Windows Server 2019 Toast Notifications

Install

PowerShell Gallery Install (Requires PowerShell v5)

Install-Module -Name BurntToast

See the PowerShell Gallery for the complete details and instructions. Don't forget to set the correct Execution Policy.

Manual Install

Download BurntToast.zip from Releases page and extract the contents into $env:userprofile\Documents\WindowsPowerShell\modules\BurntToast (you may have to create these directories if they don't exist.)

If you are using PowerShell 6 or later, extract into $env:userprofile\Documents\PowerShell\Modules\BurntToast

Please remember to "unblock" the zip file before extracting the contents. Not doing so will result in the module not working correctly. This can be done via the file properties or with Unblock-File.

Examples

New-BurntToastNotification

BurntToast Notification Example Default

New-BurntToastNotification -AppLogo C:\smile.jpg -Text "Don't forget to smile!",
                                                       'Your script ran successfully, celebrate!'

BurntToast Notification Example Custom

New-BurntToastNotification -Text 'WAKE UP!' -Sound 'Alarm2' -SnoozeAndDismiss

BurntToast Notification Example Alarm

Releases

Please note: as of v0.5.0, BurntToast no longer works on Windows 8.

  • 0.8.5

    • Actually implement the ability to use a UniqueIdentifier with the Remove-BTNotification function (which was half implemented in 0.8.4)
  • 0.8.4

    • Enhancement: Header ID on New-BTHeader is now optional. An ID will be auto generated if not specified (#125)

    • Enhancement: Hero images can now be specified using the New-BurntToastNotification function using the -HeroImage parameter (#80)

    • Enhancement: AppIDs can now be specified using the New-BurntToastNotification function using the -AppId parameter.

    • Enhancement: You can now specify a UniqueIdentifier when using the Remove-BTNotification function rather than component Tag and Group strings.

    • Fix: Weird edge cases when taking text from Twitch/IRC and using them in a toast is now sorted.

  • 0.8.3

    • Fix: Error when running Update-BTNotification on PowerShell 6.0+ (#120)

    • Fix: Error when using actionable toast parameters on any version (#122)

    • Fix: Multiple warnings about events not being supported when specifying multiple event types.

  • v0.8.2

    • Add: AdaptiveGroups are now usable via New-BTColumn
  • v0.8.1

    • Fix: Toast alias removed in 0.8.0 has been restored

    • Deprecation: Signalling removal of Shoulder Tap cmdlets in future version, v0.9.0

    • Deprecation: Signalling removal of Path parameter from New-BTAudio in future version, v0.9.0.

  • v0.8.0

    • Fix: Images from UNC path failing (#111)

    • Add: Ability to force a refresh of cached images via IgnoreCache switch on New-BTImage

    • Add: ACTIONABLE NOTIFICATIONS! Exposed via ActivatedAction and DismissedAction parameters on Submit-BTNotification and New-BurntToastNotification

  • v0.7.2

    • Fix: Curly Braces when "Reminder" pops up (#72)

    • Fix: Caching remote gifs are saved based on their remote filename and not overwritten (#105)

    • Fix: BurntToast and .NET 5 (#101)

  • see more in the Full Change Log

Contributors

License

Image Credit

The default image for BurntToast Notifications is a photo taken by Craig Sunter

Contact

burnttoast's People

Contributors

1redone avatar andibellstedt avatar azure-pipelines[bot] avatar bateskevin avatar bcurran3 avatar cedarbaum avatar cirzen avatar floh96 avatar glennsarti avatar icyfire0573 avatar kelvintegelaar avatar leongross avatar mwallner avatar paxz avatar quinlanvannunen avatar screaminghawk avatar shortarrow avatar skatterbrainz avatar steviecoaster avatar windos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

burnttoast's Issues

Dynamically Updating Toasts

Is it possible to update a toast (by using a unique identifier) without refreshing the entire toast? forgive my ignorance if i have overlooked some part of the documentation.

On click action

Is there a way to define an action that is executed when you click on the notification? Like opening a program or web page.
I know that you can add a button with such functionality, but can you do the same with the notification directly?

Online images without an extension cannot be used

If an image from a url does not have an extension, then it won't be shown.
For example: https://www.google.com/s2/favicons?domain=www.google.com

I think this is the problem code, but I can't get it working

if ($Source) {
if ($Source -like 'http?://*') {
$RemoteFileName = $Source.Split('/')[-1]
$NewFilePath = '{0}\{1}' -f $Env:TEMP, $RemoteFileName
if (!(Test-Path -Path $NewFilePath)) {
Invoke-WebRequest -Uri $Source -OutFile $NewFilePath
}
$Image.Source = $NewFilePath
} else {
$Image.Source = $Source
}
}

[feature] Option to not send notification to Action Center

I'd like to be able to send a notification, have it display for x amount of seconds, and then disappear without being sent to the Action Center.

I'm pretty new to PowerShell, so this might be possible with BurntToast and I just wasn't able to figure it out.

I can do this manually using System.Windows.Forms.NotifyIcon (this + $balloon.dispose()), but I'd rather stick with BurntToast because it's a cleaner API.

If this isn't currently possible, can a parameter be added to support it? If it is possible, can someone offer me some guidance on how to do it?

ExpirationTime CustomTimestamp

I can not make these settings work. Which is the one that allows to leave the notification on screen for a long time? If yes, how ?
Thank you !

Launch Url from toast

In C# I can designate the properties "Launch and ActivationType" like so:

var toastContent = new ToastContent()
{
Visual = new ToastVisual()
{
BindingGeneric = new ToastBindingGeneric()
{
Children =
{
new AdaptiveText()
{
Text = itemTitle
},
new AdaptiveText()
{
//Text = itemGuid
}
},
Attribution = new ToastGenericAttributionText()
{
Text = "Pima County"
}
}
},
Launch = itemGuid.ToString(),
ActivationType = ToastActivationType.Protocol

};

This allows me to click the notification and it will bring up the Url. Is this something that can be done? Also, this is great stuff! Keep up the good work!

Not working on x86 powershell

Windows 10 x64 - x86 powershell

PS C:\WINDOWS\system32> New-BurntToastNotification
Get-StartApps : The term 'Get-StartApps' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files (x86)\WindowsPowerShell\Modules\BurntToast\0.4\New-BurntToastNotification.ps1:117 char:31
+         [String] $AppId = ( ((Get-StartApps -Name '*PowerShell*') | S ...
+                               ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-StartApps:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Access Denied

Hello!
I seem to be getting an error when executing BurntToast:

Exception calling "Show" with "1" argument(s): "Access denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
At C:\WINDOWS\system32\config\systemprofile\Documents\WindowsPowerShell\Modules\BurntToast\0.6.1\Public\Submit-BTNotific
ation.ps1:70 char:5

  • [Windows.UI.Notifications.ToastNotificationManager]::CreateToastN ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : UnauthorizedAccessException
      Exception calling "Show" with "1" argument(s): "Access denied. (Exception from H
      RESULT: 0x80070005 (E_ACCESSDENIED))"
      At C:\WINDOWS\system32\config\systemprofile\Documents\WindowsPowerShell\Modules
      \BurntToast\0.6.1\Public\Submit-BTNotification.ps1:70 char:5
  • [Windows.UI.Notifications.ToastNotificationManager]::CreateToastN ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : UnauthorizedAccessException

I'm running the script as local system account

EDIT: Wrong logfile

Notifications intermittently return even after having been cleared

I've been using BurntToast for some time and I've noticed that sometimes when I check the Action Centre I'll see all notifications the module has created since I turned my computer on, even though I've previously cleared the list. They must be hanging around somewhere.

I've not worked out precisely what triggers this behaviour, and I've not seen this issue with any other program which creates notifications.

Unable to launch application using custom button

Trying to create a custom button that will launch an application but it doesn't appear to work. (SCCM Software Centre)

$audio1 = New-BTAudio -Source 'ms-winsoundevent:Notification.Reminder'
$visual1 = New-BTVisual -BindingGeneric $binding1
$button3 = New-BTButton -Content 'Launch App' -Arguments 'C:\Windows\CCM\ClientUX\SCClient.exe' -ActivationType Protocol
$action3 = New-BTAction -Buttons $button3, $button4, $button5
$content1 = New-BTContent -Audio $audio1 -Visual $visual1 -Actions $action3
Submit-BTNotification -Content $content1

Configuring the button to launch a URL works fine, however, if -Arguments is configured to a file path nothing happens when the button is clicked.

Implement/Investigate My People "Shoulder Taps" (Windows 10 1709)

Use of AppLogo from network

Hello !
Is it possible to use an -AppLogo from the network ?

For example:
\np1\Users\Public\image-notif.gif
It doesn't seems to work ... how can I do that ?

Thanks

Doesn't seem to be a way to use a custom .WAV for a notification

Hi!

Re: this thread on reddit. I noticed there doesn't seem to be a way to use my own .WAV along with a Burnt Toast noticiation.

If this is a supported scenario, could it be added to the help? I noticed that when I try to specify my own Audio file like so:

$oink = 'C:\Users\Stephen\Downloads\snort.wav'
$pigSound = New-BTAudio -Path $oink 

New-BurntToastNotification -Sound $pigSound -Text 'ham'

New-BTAudio returns an object like so, but I am not sure how to use that as a param for New-BurntToastNotification.

Src                                           Loop Silent
---                                           ---- ------
file:///C:/Users/Stephen/Downloads/snort.wav False  False

When we try to use it, we see the following:

New-BurntToastNotification -Sound $pigSound -Text 'ham'
New-BurntToastNotification : Cannot validate argument on parameter 'Sound'. The argument "Microsoft.Toolkit.Uwp.Notifications.ToastAudio" does 
not belong to the set "Default,IM,Mail,Reminder,SMS,Alarm,Alarm2,Alarm3,Alarm4,Alarm5,Alarm6,Alarm7,Alarm8,Alarm9,Alarm10,Call,Call2,Call3,Call4,
Call5,Call6,Call7,Call8,Call9,Call10" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command 
again.

I tried modifying the cmdlet and removing the ValidateSets because they prohibit me from feeding in a newly created object, but couldn't figure out the syntax.

Progressbar not working for values less than 1

Hi,

While testing I couldn't get the New-BTProgressBar to display correctly with anything -Value less than 1. 1 would show as full, anything less (0.5 for example) would show as empty.

After some testing i discovered that if i modify the New-BTProgressBar.ps1 to use the BindableProgressBarValue constructur, everything worked perfectly.

$ProgressBar.Value = [Microsoft.Toolkit.Uwp.Notifications.BindableProgressBarValue]::new($Value)

I think it might be related to my regional settings, the decimal symbol used in Sweden is a comma and not a period.

PS M:\> (0.2)
0,2

PS M:\> (0.2).gettype()

IsPublic IsSerial Name                                     BaseType                                                                                                                                                                                              
-------- -------- ----                                     --------                                                                                                                                                                                              
True     True     Double                                   System.ValueType                                                                                                                                                                                      

Having solved that issue, I'm very happy with the library, thanks for making it!

UTF-8 or Windows-1250

Hey, is there a way how to create Toast in UTF-8 or Windows-1250 (or similar)? I'm writing in my mother language (Slovak), we have special characters and BurntToast doesn't show it correctly. Any ideas?

Get ItemBox selected item

Hello all,

I'm working on a toast notification where I have to get the item of a list box selected by the user.

Currently, my notification looks well but I don't know how to retrieve the user choice ...

Is it on the "Arguments" property of the button that I have to play?

My code:

`$Content = $null

$Select1 = New-BTSelectionBoxItem -Id 'Item1' -Content 'Choice 1'
$Select2 = New-BTSelectionBoxItem -Id 'Item2' -Content 'Choice 2'
$Select3 = New-BTSelectionBoxItem -Id 'Item3' -Content 'The good choice'

$list = New-BTInput -Id 'Selection001' -Items $Select1, $Select2, $Select3 -Title "Liste of choices" -DefaultSelectionBoxItemId "Item3"

$text = New-BTText -Text "hello"

$Binding = New-BTBinding -Children $text

$Visual = New-BTVisual -BindingGeneric $Binding

$Audio = New-BTAudio -Source ms-winsoundevent:Notification.Default

$button = New-BTButton -Content "Button" -Arguments "???"

$action = New-BTAction -Inputs $list -Buttons $button

$Content = New-BTContent -Visual $Visual -Actions $action

Submit-BTNotification -Content $Content
`

If someone knows how to make it work it will be very appreciated :)

Thank you

Fresh Install, lots of red

Hey, just as a heads up. I put a fresh copy of BurntToast on my machine for use in the upcoming PowerHour, and I get a slew of red text when trying to use it:

Exception calling "GetContent" with "0" argument(s): "Could not load file or assembly 'System.Xml.ReaderWriter, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.6.2\BurntToast.psm1:1582 char:5
+     $CleanContent = $Content.GetContent().Replace('<text>{', '<text>' ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FileNotFoundException

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.6.2\BurntToast.psm1:1583 char:5
+     $CleanContent = $CleanContent.Replace('}</text>', '</text>')
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.6.2\BurntToast.psm1:1584 char:5
+     $CleanContent = $CleanContent.Replace('="{', '="')
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.6.2\BurntToast.psm1:1585 char:5
+     $CleanContent = $CleanContent.Replace('}" ', '" ')
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "LoadXml" with "1" argument(s): "Exception from HRESULT: 0xC00CE558"
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.6.2\BurntToast.psm1:1587 char:5
+     $ToastXml.LoadXml($CleanContent)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Exception

Exception calling "Show" with "1" argument(s): "The parameter is incorrect.

The parameter is incorrect.
"
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.6.2\BurntToast.psm1:1600 char:5
+     [Windows.UI.Notifications.ToastNotificationManager]::CreateToastN ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException

Sample command to reproduce:

New-BurntToastNotification -Text "Test"

Notifications don't display in Windows Fall Creator's Update

Repro steps

  1. Install an Insider build for the Fall Creator's Update (currently available in the Slow or Fast rings)
  2. Install the BurntToast Module (repros on version 0.6.0, haven't tried the development version)
  3. Attempt to send any notification (i.e. New-BurntToastNotification)

I'm not sure if this is due to an OS bug or just an API change. Wanted to make this issue known before the update is released later this year.

Cheers!

Does not seem to work?

Maybe I am doing something wrong.. but I've tried BT under PS x64, and PS x86, and even in basic mode, I run a simple test after importing the module (both PS versions):
New-BurntToastNotification -Text 'Burnt Toast Test'
And nothing seems to happen.. The help MD documents are fairly empty, so I'm kind of at a loss.

Just in case, here is my $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Poking around, I also saw that you could possibly add multiple lines, but the parameters don't seem to say that..

I appreciate any help :-)

Thank you,

David F.

Notification icon seems to be dark

Not sure how to correct this one. When I try to create just a default toast to say 'hi' for example, it shows in the notification area very dark.

notification

New-BtP

Successful usage of button based toast. However, when trying to use the new-BtProgressbar I'm not getting it to show up. I did have it show up in the past but at this time I can't get it to show.

New-BTProgressBar -Status 'Running'  -Value ([double]$PercentDone) -ValueDisplay ("$counter of $TotalToProcess done") -Title "Task: Startup Apps - Loading $($a.ExeToLaunchWith)" 

Example script to demo

$verbosepreference = 'continue'
$debugpreference = 'continue'


Import-Module -name BurntToast -DisableNameChecking

[double]$PercentDone = 0
[double]$TotalToProcess = 10
for ([double]$x = 0; $x -lt 100; $x++) {
    write-debug "Loop: $x"
    New-BTProgressBar -Status 'Running'  -Value ([double]$x/100) -ValueDisplay ("$x of $TotalToProcess done") -Title "Test Title" -Verbose
    
}

Output on console shows only

Microsoft.Toolkit.Uwp.Notifications.BindableString Microsoft.Toolkit.Uwp.Notifications.BindableProgressBarValue

No progress dialogue is shown.

Any ideas?

"Operation is not supported" on Module load

Problem:

PS path> Import-Module -Name .\BurntToast
pathtomodule\BurntToast\BurntToast.psm1 : Failed to load library pathtomodule\BurntToast\lib\Microsoft.Toolkit.Uwp.Notifications\Microsoft.Toolkit.Uwp.Notifications.dll: Could not load file or assembly 'file:///pathtomodule\BurntToast\lib\Microsoft.Toolkit.Uwp.Notifications\Microsoft.Toolkit.Uwp.Notifications.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ Import-Module -Name .\BurntToast
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,BurntToast.psm1`

Cause:
When downloading DLLs Microsoft puts a block on them for safety reasons.

Solution:
Unblock the DLL in explorer:
image

Alternatively unblock it using the powershell command Unblock-File: https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Unblock-File?view=powershell-5.1

Suggestion:
Maybe adding this to the readme, or adding a note somewhere explaining that this might be needed to be done to fix the loading problem.

Possible to send Toast from SYSTEM to logged in user?

(I was going to make a feature request, but based on #33, I have a feeling you might already have a solution and provide it faster than me figuring it out! :)

USE CASE:
I have schedule task that runs as /RU SYSTEM. I would like to use BurntToast to send a notification from the task to the currently logged in user. Is this possible? (Yeah, I know. EVERYTHING is possible in PowerShell!) How do you recommend I go about it?

REF:
https://chocolatey.org/packages/chocolatey-toast-notifications.extension
https://chocolatey.org/packages/choco-upgrade-all-at

Curly Braces when "Reminder" pops up

Hey there,

I'm digging into this awesome tool at the moment and I came around a bug.

I'm triggering a reminder, that the device hasn't rebooted for a specifc time with a Snooze Button.
The first time I fire up the Notification I have a good presentation of my toast:

image

Then I press the Snooze Button and wait for it to appear again. This time the text has curly braces around the text:

image

I am using Windows 10 1903 for my tests but it also happens on 1809.

Here is my code:

[int]$Uptime_hours = ((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime).TotalHours

if ($Uptime_hours -gt 95)
{

$Text1 = New-BTText -Content "It's time for a reboot" -Style Header
$Text2 = New-BTText -Content "Your device is running for: $Uptime_Hours hours" -Style Body
$Image1 = New-BTImage -Source 'C:\Temp\Images\BurntToast.png' -AppLogoOverride -Crop Circle

$Binding = New-BTBinding -Children $Text1, $Text2 -AppLogoOverride $Image1
$Visual = New-BTVisual -BindingGeneric $Binding


$Button1 = New-BTButton -Snooze -Content "Snooze" -Id 'Toast_Uptime_Snooze'
$Action1 = New-BTAction -Buttons $Button1
$Content = New-BTContent -Visual $Visual -Actions $Action1


Submit-BTNotification -Content $Content -UniqueIdentifier "Toast_Uptime"
}

Module crashing on Windows 10 machine

Hi,

I get the following exception when trying to use the New-BurnttoastNotification cmdlet:

Multiple ambiguous overloads found for ".ctor" and the argument count: "1".
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\Submit-BTNotification.ps1:29 char:5
+     [OutputType($null)]
+     ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

The issue seems to be [OutputType($null)]. I commented the line out manually in my local installation, and then the module seems to work without any issues. Maybe Microsoft have added some overloaded constructors for the OutputType attribute in newer versions of their frameworks, which means that Powershell can no longer resolve a constructor for $null.

Edit: It seems that this issue is reocurring across multiple other cmdlets in the module.

Default Interval value is invalid

An error is thrown when calling the function in Example05 without parameters.

It works, as the toast is shown immediately. I think it would be cool if the hours/minutes/seconds values are requested when not supplied, and the toast is rejected if the result is zero.

PS C:\Users\MichaelSta\Programs> New-ToastReminder

cmdlet New-ToastReminder at command pipeline position 1
Supply values for the following parameters:
ReminderTitle: Ahem
ReminderText: Do the thing
Exception setting "Interval": "'0' is not a valid value for 'Interval'. 'Interval' must be greater than 0."
At C:\Users\MichaelSta\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:71 char:9
+         $Timer.Interval = $IntervalSpan.TotalMilliseconds
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
    + FullyQualifiedErrorId : ExceptionWhenSetting

Add example(s) of useful toast notifications created using BurntToast

Add examples of useful toast notifications that you've created using BurntToast, and feature them on this projects README.

Include any setup needed (e.g. getting the latest item from an RSS feed), the code, and a screenshot (bonus points if it's animated!)

Instructions

  1. Fork this repo
  2. Create a new folder under /Examples
  3. Include a .PS1 with your demo code
  4. Include a screenshot of the resulting toast (consider an app like GifCam to get an animated example!)
  5. Add your example under the Examples section of the README for all to see!
  6. Send your Pull Request
  7. Don't be shy!

If you need a hand, let me know.

(Thanks to @Stephanevg for the inspiration!)

0.62 Submit-BTNotification not working on April 2018 Update (1803)

A couple of issues, actually, with the April Win10 update 1803 where Submit-BTNotification runs successfully, but no toast is displayed. Wondering if anybody else is having this issue? The script ran fine up to 1709 with BT 0.61, but 1803 seems to have changed something. We have BT notification scripts running as a scheduled task in system context, but even as admin user context no toasts are displayed.

New-BurntToastNotification does run and creates a toast in the notification center, but doesn't pop out.

Anybody else seen this?

install.ps1 isn't idempotent

I'm rerunning the install.ps1 in a deployment script, but it doesn't appear to gracefully handle if BurntToast has already been installed:

# command
iex ((New-Object net.webclient).DownloadString('https://raw.githubusercontent.com/Windos/BurntToast/master/install.ps1')) ;

Have you thought about putting this into chocolatey? Its a great tool.

image

Installed, but no commands available

After installing the module, I cannot use it.

I get the following message:

PS C:\WINDOWS\system32> New-burntoastnotification
New-burntoastnotification : The term 'New-burntoastnotification' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ New-burntoastnotification
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-burntoastnotification:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I confirmed that the module is actually installed, and accessible, but it lists no ExportedCommands (Output truncated for brevity.):

PS C:\WINDOWS\system32> Get-Module -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.5.1      BurntToast

I checked that I'm running Powershell v5.1...

PS C:\WINDOWS\system32> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Am I missing a step here? What am I doing wrong?

BurntToast Install

hi, i take BurntToast.zip and i unzip this file in C:\Users\Moi\Documents\WindowsPowerShell\modules
when i make "Import-Module" on my Powerhsell termincal, i have multiple error like this...

image

New-BTText with style adds characters to the content

Hello,

If you run the following code you end up with an initial { before the text you specify:
New-BTText -Text 'My Text' -Style Title

Which style i use does not seem to matter but i didnt try them all.

I am using:
Windows 10 1803 with latest CU
WindowsPowershell 5.1
BurntToast 0.6.2

Question about notifications

Quick question,

Is it possible to reuse a notification. We are trying to get people to reboot their computers more frequently after windows updates. I have a script that runs every 30 minutes and checks for a pending reboot, if there is one, a toast will be displayed. If a PC needs a reboot and the user is away form their PC for say an hour, they will come back to multiple toast notifications. It would be nice to be able to reuse the same one over again if possible.

I was able to do this with the balloontip function, but not sure how to do this with the burnttoast function.

Thanks for an amazing script by the way. This has been very helpful.

Get-BurnToast

Feature Request:

Get-BurntToastNotification - retrieve all notifications from the notification center.

Possible to send Toast to another Win 10 box on the network?

I have an need to send a toast to another Win 10 box on my LAN after a home automation event is triggered on my automation rig.

I could run BurntToast on the remote boxes, but not sure if that matters.

I'm not a programmer... but a tinkerer... so was able to get your app running fine and triggered correctly on my local box. Just hoping it will do that extra bit.

Thanks!

New-BTButton with logo/image

Hello !
Thanks for this great repository, well documentated.
I am trying to display buttons on the Toast Alert.
I managed to display with

$Button1 = New-BTButton -Content 'bien' -Arguments 'https://google.com'
New-BurntToastNotification -Text "How are you doing ?" -Button ($Button1)

However I would like to display my button with a little image/logo on it, is it possible ?
Thanks in advance

Invoking BurntToast in ooRexx on Windows 10

BurntToast.rex.txt

I am successfully calling BurntToast from an ooRexx program -- see attached. But I had problems getting it to work. I kept getting a message that 'Get-StartApps' was not a valid cmdlet...

So I edited New-BurntToastNotification.ps1 line 117 and made it a comment:

[String] $AppId = ( ((Get-StartApps -Name 'PowerShell') | Select-Object -First 1).AppId ),

and changed line 118 from blank to:
[String] $Appid = 'PowerShell',
all is well now and I'm very happy with BurntToast..

What is the purpose of line 117? Will I run into trouble without it?

I need a little help -- I can't figure out how to specify my own image without changing the default in the source.

ShoulderTap Not Working (Win10 Ent 1803 and 1809)

Not sure if I've got some weird edge case thing going here but here's what I know might be different from typical testing scenarios

Environment

  • Win10 Ent
    • First tried under 1803, then updated to 1809, no change.
  • Multiple in-place major version upgrades (not a clean install)
  • O365/ADFS integrations
  • Skype for Business present
  • Windows Store Disabled by GP
  • Mail app not configured

Steps Tried

  • New-BTAppId - as per blog post
    New-BTAppId -AppId 'Microsoft.People_8wekyb3d8bbwe!x4c7a3b7dy2188y46d4ya362y19ac5a5805e5x'
  • Check ShoulderTap regkey value is set to 'on' (1)
    (Get-ItemProperty -Path 
    hkcu:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People\ShoulderTap -Name ShoulderTap).ShoulderTap -eq 1
  • Turn shoulder tap off by setting value to zero, reboot, turn it back on, reboot, try again
  • Try using a locally saved copy of the gif instead of the imgur link from the blog post

No dice on anything so far, not sure what I'm doing wrong.

Notifications are faded in Action Center

Just came across this project today and it's working great with one slight exception. The toasts display correctly in the toast popup, but when you view the toast in the Action Center, all of the content objects are dimmed/faded. Title text that should be white appears gray, images appear as though the brightness has been reduced by 50%. See images below for example. Notice the contrast between my test notification and those generated by the Mail app. This is on Windows 10, version 1703.

Edit: The display issue is not experienced on the Anniversary Update (version 1607).

This is the toast popup:
image

This is the same toast in Action Center:
burnttoastexample

BurntToast was working then stopped

I was successfully running version 0.5.2 in Windows 10 Pro and then decided to upgrade to version 0.6.0. I opened a PowerShell session and I was issuing various BurntToast commands with success and for some reason I started getting errors on every attempt. I tried re-installing 0.5.2 and it wouldn't work with same error messages. I then did a System Restore to a point before installing 0.6.0. I removed BurntToast folder from C:\Users\Fran\Documents\WindowsPowerShell\Modules and then manually installed 0.6.1. Still no joy! Below is output from trying New-BurntToastNotification

PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib> dir
Directory: C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib
Mode LastWriteTime Length Name


d----- 6/23/2017 12:45 PM Microsoft.Toolkit.Uwp.Notifications

PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib> cd ..
PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast> New-BurntToastNotification
Unable to find type [Microsoft.Toolkit.Uwp.Notifications.IToastButton].
At C:\Users\Fran\Documents\WindowsPowerShell\Modules\BurntToast\Public\New-BurntToastNotification.ps1:149 char:9

  •     [Microsoft.Toolkit.Uwp.Notifications.IToastButton[]] $Button,
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (Microsoft.Toolk...ns.IToastButton:TypeName) [], RuntimeException
    • FullyQualifiedErrorId : TypeNotFound

PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast>
PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast> cd lib
PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib> dir

Directory: C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib

Mode LastWriteTime Length Name


d----- 6/23/2017 12:45 PM Microsoft.Toolkit.Uwp.Notifications

PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib> cd Microsoft.Toolkit.Uwp.Notifications
PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib\Microsoft.Toolkit.Uwp.Notifications> dir

Directory: C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib\Microsoft.Toolkit.Uwp.Notifications

Mode LastWriteTime Length Name


-a---- 6/23/2017 12:45 PM 90456 Microsoft.Toolkit.Uwp.Notifications.dll
-a---- 6/23/2017 12:45 PM 284160 Microsoft.Toolkit.Uwp.Notifications.pdb
-a---- 6/23/2017 12:45 PM 113822 Microsoft.Toolkit.Uwp.Notifications.xml

PS C:\users\fran\documents\WindowsPowerShell\modules\burnttoast\lib\Microsoft.Toolkit.Uwp.Notifications>

Custom Text

Not sure if this is an issue or not. When I run the script, is there a way to get rid of the text that says Windows PowerShell at all?

burnttoast

Error when doing import of module for 0.5 / 0.5.1

Hi,
Got following error
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTAction.ps1: Multiple ambiguous overloads found for ".ctor" and the argume
nt count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTAudio.ps1: Multiple ambiguous overloads found for ".ctor" and the argumen
t count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTBinding.ps1: Multiple ambiguous overloads found for ".ctor" and the argum
ent count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTButton.ps1: Multiple ambiguous overloads found for ".ctor" and the argume
nt count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTContent.ps1: Multiple ambiguous overloads found for ".ctor" and the argum
ent count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTContextMenuItem.ps1: Multiple ambiguous overloads found for ".ctor" and t
he argument count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTImage.ps1: Multiple ambiguous overloads found for ".ctor" and the argumen
t count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTInput.ps1: Multiple ambiguous overloads found for ".ctor" and the argumen
t count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTSelectionBoxItem.ps1: Multiple ambiguous overloads found for ".ctor" and
the argument count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTText.ps1: Multiple ambiguous overloads found for ".ctor" and the argument
count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\New-BTVisual.ps1: Multiple ambiguous overloads found for ".ctor" and the argume
nt count: "1". (raised by: Write-Error)
Failed to import function C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.5.0\Public\Advanced\Submit-BTNotification.ps1: Multiple ambiguous overloads found for ".ctor" and t
he argument count: "1". (raised by: Write-Error)

Implement Toast Collections (Windows 10 1703 Feature)

"Use collections to organize your app's toasts in Action Center. Collections help users locate information within Action Center more easily and allow for developers to better manage their notifications. The APIs below allow for removing, creating, and updating notification collections."

https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/toast-collections

https://docs.microsoft.com/en-us/uwp/api/windows.ui.notifications.toastcollection
https://docs.microsoft.com/en-us/uwp/api/windows.ui.notifications.toastcollectionmanager

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.