Giter Club home page Giter Club logo

Comments (6)

RockFox avatar RockFox commented on July 17, 2024

Update: BurntToast is working fine when invoked by an ooRexx program:

AppLogo = 'C:\Users\Fran\Documents\WindowsPowerShell\Modules\BurntToast\Images\MinistryScheduler.png'
BurntToast = "PowerShell New-BurntToastNotification"
BurntToastDebug = 'PowerShell Set-PSDebug -Trace 1; New-BurntToastNotification'
-- One string of white text on the first line, one string of regular text on second line, and image.
BurntToastDebug "-text 'Ministry Scheduler', 'Don''t forget to check for conflicts' -applogo" AppLogo

screenshot 6

from burnttoast.

RockFox avatar RockFox commented on July 17, 2024

Same program as I reported working on Jun 25: (Windows 10 Pro Version 1703, BurntToast 0.6.1)

DEBUG: 1+ Set-PSDebug -Trace 1; >>>> New-BurntToastNotification -text 'Ministry Scheduler', 'Don''t forget to check
for conflicts' -applogo C:\Users\Fran\Documents\WindowsPowerShell\Modules\BurntToast\Images\MinistrySchedulerPro.ico

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\Users\Fran\Documents\WindowsPowerShell\Modules\BurntToast\BurntToast.psm1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
DEBUG: 19+ if ( & >>>> { Set-StrictMode -Version 1; $.PSMessageDetails } )
{
DEBUG: 19+ if ( & { >>>> Set-StrictMode -Version 1; $
.PSMessageDetails } )
{
DEBUG: 19+ if ( & { Set-StrictMode -Version 1; >>>> $.PSMessageDetails } )
{
DEBUG: 1+ & >>>> { Set-StrictMode -Version 1; $this.Exception.InnerException.PSMessageDetails }
DEBUG: 1+ & { >>>> Set-StrictMode -Version 1; $this.Exception.InnerException.PSMessageDetails }
DEBUG: 1+ & { Set-StrictMode -Version 1; >>>> $this.Exception.InnerException.PSMessageDetails }
DEBUG: 1+ & { Set-StrictMode -Version 1; $this.Exception.InnerException.PSMessageDetails >>>> }
DEBUG: 19+ if ( & { Set-StrictMode -Version 1; $
.PSMessageDetails >>>> } )
{
DEBUG: 26+ $errorCategoryMsg = & >>>> { Set-StrictMode -Version 1;
$.ErrorCategory_Message }
DEBUG: 26+ $errorCategoryMsg = & { >>>> Set-StrictMode -Version 1;
$
.ErrorCategory_Message }
DEBUG: 26+ $errorCategoryMsg = & { Set-StrictMode -Version 1; >>>>
$.ErrorCategory_Message }
DEBUG: 26+ $errorCategoryMsg = & { Set-StrictMode -Version 1;
$
.ErrorCategory_Message >>>> }
DEBUG: 42+ $originInfo = & >>>> { Set-StrictMode -Version 1; $.OriginInfo
}
DEBUG: 42+ $originInfo = & { >>>> Set-StrictMode -Version 1; $
.OriginInfo
}
DEBUG: 42+ $originInfo = & { Set-StrictMode -Version 1; >>>> $.OriginInfo
}
DEBUG: 42+ $originInfo = & { Set-StrictMode -Version 1; $
.OriginInfo >>>>
}
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

from burnttoast.

RockFox avatar RockFox commented on July 17, 2024

Update: On a Windows 10 Pro Version 1607 that never had BurntToast installed I invoked Command Prompt (Admin) then PowerShell and did a PowerShell Gallery Install of BurntToast. All went well. Here is a transcript of the whole session:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\WINDOWS\system32> Install-Module -Name BurntToast

NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\Fran\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running
'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import
the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
PS C:\WINDOWS\system32> New-BurntToastNotification
New-BurntToastNotification : The 'New-BurntToastNotification' command was found in the module 'BurntToast', but the
module could not be loaded. For more information, run 'Import-Module BurntToast'.
At line:1 char:1

  • New-BurntToastNotification
  •   + CategoryInfo          : ObjectNotFound: (New-BurntToastNotification:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
    
    

PS C:\WINDOWS\system32> Import-Module BurntToast
Import-Module : File C:\Program Files\WindowsPowerShell\Modules\BurntToast\0.6.0\BurntToast.psm1 cannot be loaded
because running scripts is disabled on this system. For more information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • Import-Module BurntToast
  •   + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
    

PS C:\WINDOWS\system32> set-executionpolicy remotesigned
PS C:\WINDOWS\system32> Import-Module BurntToast
PS C:\WINDOWS\system32> New-BurntToastNotification
WARNING: The AppId BurntToast is not present in the registry, please run New-BTAppId to avoid inconsistent Toast
behaviour.
PS C:\WINDOWS\system32> New-BTAppID BurnetToast
PS C:\WINDOWS\system32> New-BurntToastNotification
WARNING: The AppId BurntToast is not present in the registry, please run New-BTAppId to avoid inconsistent Toast
behaviour.
PS C:\WINDOWS\system32> New-BTAppID BurntToast
PS C:\WINDOWS\system32> New-BurntToastNotification
PS C:\WINDOWS\system32> New-BurntToastNotification -Text "Don't forget to smile!", 'Your script ran successfully, celebrate!' -AppLogo C:\smile.jpg

PS C:\WINDOWS\system32> New-BurntToastNotification -Text 'WAKE UP!' -Sound 'Alarm2' -SnoozeAndDismiss
PS C:\WINDOWS\system32>

from burnttoast.

RockFox avatar RockFox commented on July 17, 2024

Resolved: I think I have found the reason for my problems with BurntToast.

The PowerShell Gallery Install put BurntToast in
C:\Program Files\WindowsPowerShell\Modules

The manual install instructions say to unzip and copy to:
C:\Users[user]\Documents\WindowsPowerShell\Modules

In trying to resolve my problems I think I used BOTH install procedures.

I deleted the
C:\Users[user]\Documents\WindowsPowerShell
And then used the PowerShell Gallery Install. I did a few tests and BurntToast seems to be working well.

Note that the Smile example has -AppLogo C:\smile.jpg
This .jpg does not exist in Images folder.

from burnttoast.

Windos avatar Windos commented on July 17, 2024

I wonder if the manual install was suffering from the same issue as #21, where the DLLs were being blocked by Windows?

My understanding is that if the module is downloaded via the gallery then they aren't blocked.

If you do want the module to be located in your user profile when installing from the gallery you can do so with the Scope parameter:

Install-Module -Name BurntToast -Scope CurrentUser

from burnttoast.

Windos avatar Windos commented on July 17, 2024

I've added a note about unblocking the zip file to the README, in case that was the issue here. Preference should be to download from the Gallery (which avoids the blocking issue).

from burnttoast.

Related Issues (20)

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.