PowerShell/Scripts/open-thunderbird.ps1

27 lines
680 B
PowerShell
Raw Normal View History

2021-11-06 11:52:58 +01:00
<#
.SYNOPSIS
Launches the Thunderbird app
2021-11-06 11:52:58 +01:00
.DESCRIPTION
This script launches the Mozilla Thunderbird email application.
2021-11-06 11:52:58 +01:00
.EXAMPLE
2021-11-29 10:44:26 +01:00
PS> ./open-thunderbird
2021-11-06 11:52:58 +01:00
.LINK
https://github.com/fleschutz/PowerShell
2022-09-06 21:42:04 +02:00
.NOTES
Author: Markus Fleschutz | License: CC0
2021-11-06 11:52:58 +01:00
#>
function TryToExec { param($Folder, $Binary)
if (test-path "$Folder/$Binary" -pathType leaf) {
start-process "$Folder/$Binary" -WorkingDirectory "$Folder"
exit 0 # success
}
}
try {
TryToExec "C:\Program Files (x86)\Mozilla Thunderbird" "thunderbird.exe"
throw "It seems Thunderbird isn't installed yet."
} catch {
& "$PSScriptRoot/give-reply.ps1" "Sorry: $($Error[0])"
}