Windos / BurntToast

Module for creating and displaying Toast Notifications on Microsoft Windows 10.
MIT License
1.41k stars 122 forks source link

[Bug]: MethodInvocationException: Exception calling "Show" with "1" argument(s): "Access is denied. #211

Open ghost opened 1 year ago

ghost commented 1 year ago

Steps to Reproduce

Run PowerShell as Admin, Type New-BurntToastNotification or New-BurntToastNotification -Text 'WAKE UP!' -Sound 'Alarm2' -SnoozeAndDismiss

Expected Behavior

I expect the module to work and show me toast notification

Actual Behavior

it gives me an error: MethodInvocationException: Exception calling "Show" with "1" argument(s): "Access is denied. (0x80070005 (E_ACCESSDENIED))"

image

Experience with Toast

No response

Environment data: PowerShell

Name                           Value
----                           -----
PSVersion                      7.3.0-preview.8
PSEdition                      Core
GitCommitId                    7.3.0-preview.8
OS                             Microsoft Windows 10.0.25217
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Environment data: OS

OsName         : Microsoft Windows 11 Pro for Workstations Insider Preview
OsVersion      : 10.0.25217
OsArchitecture : 64-bit

Environment data: BurntToast

Directory: C:\Users\Admin\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     0.8.5                 BurntToast                          Desk      {Get-BTHistory, New-BTAction, New-BTApp…

Consent to Attribution

juansone commented 1 year ago

Was able to replicate this issue while testing by running the "New-BurntToastNotification' command. image

I was able to address the error by runing Powershell as the current logged in user as oppossed to using another account with admin access via Run As.

Environment data: OS

Caption                 : Microsoft Windows 11 Enterprise
Version                 : 10.0.22621
ServicePackMajorVersion : 0
OSArchitecture          : 64-bit
CSName                  : ARDA
WindowsDirectory        : C:\WINDOWS