2022-02-25 13:08:25 +01:00
|
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Sets the working directory to the fonts folder
|
|
|
|
|
.DESCRIPTION
|
|
|
|
|
This PowerShell script changes the working directory to the fonts folder.
|
|
|
|
|
.EXAMPLE
|
|
|
|
|
PS> ./cd-fonts
|
2022-02-25 13:15:01 +01:00
|
|
|
|
📂C:\Windows\Fonts
|
2022-02-25 13:08:25 +01:00
|
|
|
|
.LINK
|
|
|
|
|
https://github.com/fleschutz/PowerShell
|
|
|
|
|
.NOTES
|
2022-05-04 11:50:18 +02:00
|
|
|
|
Author: Markus Fleschutz | License: CC0
|
2022-02-25 13:08:25 +01:00
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$Path = [Environment]::GetFolderPath('Fonts')
|
|
|
|
|
if (-not(Test-Path "$Path" -pathType container)) {
|
|
|
|
|
throw "Fonts folder at 📂$Path doesn't exist (yet)"
|
|
|
|
|
}
|
2022-05-04 11:50:18 +02:00
|
|
|
|
Set-Location "$Path"
|
2022-02-25 13:08:25 +01:00
|
|
|
|
"📂$Path"
|
|
|
|
|
exit 0 # success
|
|
|
|
|
} catch {
|
2022-04-13 12:06:32 +02:00
|
|
|
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
2022-02-25 13:08:25 +01:00
|
|
|
|
exit 1
|
|
|
|
|
}
|