The answers to this question address the first part of my question.
Unfortunately when I schedule a job such that the powershell window is hidden, any toast notifications that my script sends are not shown. The script shows toast notifications using this script (source):
Add-Type -AssemblyName System.Windows.Forms
$global:balloon = New-Object System.Windows.Forms.NotifyIcon
$path = (Get-Process -id $pid).Path
$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path)
$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning
$balloon.BalloonTipText = 'What do you think of this balloon tip?'
$balloon.BalloonTipTitle = "Attention $Env:USERNAME"
$balloon.Visible = $true
$balloon.ShowBalloonTip(5000)
When I schedule the powershell script in a way that it's not hidden, notifications are shown, but every time the script is triggered I briefly see a powershell window.
How can I schedule a task or job that hides the powershell window, but shows toast notifications?