Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast History access failure on PowerShell 7.2.1 #190

Open
1 task done
IanBAdams opened this issue Jan 31, 2022 · 2 comments
Open
1 task done

Toast History access failure on PowerShell 7.2.1 #190

IanBAdams opened this issue Jan 31, 2022 · 2 comments
Assignees

Comments

@IanBAdams
Copy link

Steps to Reproduce

Get-BTHistory -AppId 'Windows.Defender.SecurityCenter'

Note: I've tried the code with a number of different PowerShell versions. The code also fails with PowerShell 7.1.5 but works successfully with Windows PowerShell 5.1 and PowerShell 7.0.8.

Note2: I am aware of the issue 'Toast History access and Toast removal failures on PowerShell 7.1 #136'. However I believe this is a different issue because: 
- The actual behaviour is different for the two issues.
- I am successfully using Remove-BTNotification within my scripts (and was able to do so with PowerShell 7.1).

Expected Behavior

The Get-BTHistory function to return the toast notifications in the Action Center. In my case should display something like:

ExpirationTime : 02/02/2022 03:38:44 +00:00
Content : Windows.Data.Xml.Dom.XmlDocument
Tag : YWD0SOEHhUSFvy/d.0
SuppressPopup : False
Group : 23
RemoteId :
NotificationMirroring : 1025960913
Priority : Default
Data :
ExpiresOnReboot : False

Actual Behavior

Returns:

ObjRef : WinRT.ObjectReferenceWithContext1[WinRT.IInspectable+Vftbl] ThisPtr : 1803460262104 NativeObject : WinRT.ObjectReferenceWithContext1[WinRT.IInspectable+Vftbl]
HasUnwrappableNativeObject : True
AdditionalTypeData : {[System.RuntimeTypeHandle, ABI.System.Collections.IEnumerable+AdaptiveFromAbiHelper]}

Experience with Toast

Intermediate

Environment data: PowerShell

Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.19044
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 10 Pro
OsVersion      : 10.0.19044
OsArchitecture : 64-bit

Environment data: BurntToast

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

Consent to Attribution

  • Please shout me out if I've inspired a blog post!
@IanBAdams IanBAdams changed the title [Bug]: Toast History access failure on PowerShell 7.2.1 Toast History access failure on PowerShell 7.2.1 Feb 4, 2022
@Windos
Copy link
Owner

Windos commented Mar 19, 2022

Yeah, this is the same issue as #136, there were some underlying .NET changes in PowerShell 7.1 which broke a lot of stuff and evidently, I missed applying the fix to Get-BTHistory.

This'll be sorted in v1.

@IanBAdams
Copy link
Author

Many thanks for getting back to me on this.

At the moment I'm running Get-BTHistory within a Windows PowerShell session (5.1) which is called from PowerShell 7.2.1 so I'm in no hurry for a fix for this.

I'll keep an eye on v1 and once you add Get-BTHistory (or it's replacement) I'll test / amend my scripts as necessary. I'm only using a fraction of the capabilities of Burnt Toast (use the commands New-BTHeader, New-BurntToastNotification, Remove-BTNotification and Get-BTHistory.) so shouldn't take me long to make the changes required by v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants