#Requires -Version 5.1 <# .SYNOPSIS Shows a WPF notification popup for the OBS Replay Buffer tool. Must be launched via Start-Process with powershell.exe -STA. .PARAMETER Type 'BufferStarted' — shown at logon when the replay buffer is active. 'ReplaySaved' — shown after a successful replay save. #> param( [Parameter(Mandatory)] [ValidateSet('BufferStarted', 'ReplaySaved')] [string]$Type, [string]$ContactNumber = '', [int]$BufferMinutes = 0, [string]$FileName = '', [double]$FileSizeMB = 0 ) Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName WindowsBase Add-Type -AssemblyName System.Drawing $hBitmap = [System.Drawing.SystemIcons]::Shield.ToBitmap().GetHbitmap() $wpfImage = [System.Windows.Interop.Imaging]::CreateBitmapSourceFromHBitmap( $hBitmap, [IntPtr]::Zero, [System.Windows.Int32Rect]::Empty, [System.Windows.Media.Imaging.BitmapSizeOptions]::FromEmptyOptions() ) [System.Runtime.InteropServices.Marshal]::DeleteObject($hBitmap) if ($Type -eq 'BufferStarted') { [xml]$xaml = @"