PowerShell/Scripts/open-thunderbird.ps1

27 lines
683 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 {
2022-11-18 16:54:04 +01:00
& "$PSScriptRoot/speak-english.ps1" "Sorry: $($Error[0])"
}