Windos/BurntToast

Unable to use AppIcon with UNC Icon file path

orieben opened this issue · 3 comments

Steps to reproduce

New-BurntToastNotification -Silent -Text $WText -AppLogo "\\dsa.dom\sys\COMLST\Startup\NAL\Icons\warning.ico" -UniqueIdentifier 'ShadowSession'

Expected behavior

Notification issued

Actual behavior

Suspected $env:TEMP is returning a DOS 8.3 : C:\Users\ADMINI~1.DSA\AppData\Local\Temp (a PowerShell bug)
but seems more to be related to an UNC path transformation for the temporary file where the full path is kept

Copy-Item : Could not find a part of the path 'C:\Users\administrator.DSA\AppData\Local\Temp\dsa.dom\sys\COMLST\Startup\NAL\Icons\warning.ico'.
At C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.7.2\BurntToast.psm1:14 char:17

  •             Copy-Item -Path $Source -Destination $NewFilePath
    
    • CategoryInfo : NotSpecified: (:) [Copy-Item], DirectoryNotFoundException
    • FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand

Environment data

Name                           Value                                                                                                                                                                   
----                           -----                                                                                                                                                                   
PSVersion                      5.1.17763.1007                                                                                                                                                          
PSEdition                      Desktop                                                                                                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                 
BuildVersion                   10.0.17763.1007                                                                                                                                                         
CLRVersion                     4.0.30319.42000                                                                                                                                                         
WSManStackVersion              3.0                                                                                                                                                                     
PSRemotingProtocolVersion      2.3                                                                                                                                                                     
SerializationVersion           1.1.0.1      
OsName         : Microsoft Windows Server 2019 Standard
OsVersion      : 10.0.17763
OsArchitecture : 64-bit
Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands                                                                                                                             
---------- -------    ----                                ----------------                                                                                                                             
Script     0.7.2      BurntToast                          {Get-BTHistory, New-BTAction, New-BTAppId, New-BTAudio...}                                                                                   

Ahh... fairly certain I know what the fix here is. Thanks for the report, @orieben!

Hey @orieben, there's a fix for this that will be release with v0.8.0

If you're at all interested, you can see this fix being implemented and tested on this live stream VOD.