$outlook = Get-Process outlook -ErrorAction SilentlyContinue if ($outlook) { $olApp = New-Object -ComObject Outlook.Application $olApp.Quit() Remove-Variable olApp Sleep 15 if (!$outlook.HasExited) { $outlook | Stop-Process -Force } } Remove-Variable outlook
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter