ps/Modules/Cole.PowerShell.Developer/Scratch/how do I show toasts from hidden windows.ps1

11 lines
1.6 KiB
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
ipmo Z:\git\cole_module\Modules\Cole.PowerShell.Developer\Cole.PowerShell.Developer.psd1;Show-ToastNotification -ToastTitle "hello from the command line" -ToastText "this is some shit";
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\Users\cbrand\Desktop\show-notification.ps1 -NoLogo -NoProfile -NonInteractive -WindowStyle Hidden
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoLogo -NoProfile -NonInteractive -Command "& {ipmo Z:\git\cole_module\Modules\Cole.PowerShell.Developer\Cole.PowerShell.Developer.psd1;Show-ToastNotification -ToastTitle 'hello from the command line' -ToastText 'this is some shit';}"
$t = '[DllImport("user32.dll")] public static extern bool ShowWindow(int handle, int state);';add-type -name win -member $t -namespace native;[native.win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0);
cmd /c start /min "" powershell -WindowStyle Hidden -ExecutionPolicy Bypass -Command "& {ipmo Z:\git\cole_module\Modules\Cole.PowerShell.Developer\Cole.PowerShell.Developer.psd1;Show-ToastNotification -ToastTitle 'hello from the command line' -ToastText 'this is some shit';}"
mshta vbscript:Execute("CreateObject(""WScript.Shell"").Run ""C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoLogo -NoProfile -NonInteractive -Command ""& {ipmo Z:\git\cole_module\Modules\Cole.PowerShell.Developer\Cole.PowerShell.Developer.psd1;Show-ToastNotification -ToastTitle 'hello from the command line' -ToastText 'this is some shit';}"""", 0:close")