Add unicode character

This commit is contained in:
Markus Fleschutz 2021-04-17 18:13:23 +02:00
parent 76e6cc1118
commit 370fe6c7dc
10 changed files with 17 additions and 23 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX list-clipboard.ps1
.DESCRIPTION lists the contents of the clipboard
@ -7,7 +7,7 @@
#>
try {
get-clipboard
"📋 $(get-clipboard)"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX list-commits.ps1 [<repo-dir>] [<format>]
.DESCRIPTION lists all commits in the current/given Git repository
@ -32,6 +32,6 @@ try {
write-output ""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ ERROR: $($Error[0]) (line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX list-earthquakes.ps1
.DESCRIPTION lists earthquakes with magnitude >= 6.0 for the last 30 days

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX list-tags.ps1 [<repo-dir>] [<pattern>]
.DESCRIPTION lists all tags in the current/given Git repository
@ -9,8 +9,6 @@
param($RepoDir = "$PWD", $Pattern="*")
try {
write-output "Fetching updates for Git repository $RepoDir ..."
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX mute-audio.ps1
.DESCRIPTION mutes the audio
@ -9,8 +9,7 @@
try {
$obj = new-object -com wscript.shell
$obj.SendKeys([char]173)
write-host -foregroundColor green "Done."
"🔇 audio muted."
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX open-browser.ps1 [<URL>]
.DESCRIPTION starts the default Web browser, optional with given URL
@ -6,11 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($URL = "")
if ($URL -eq "" ) {
$URL = "http://www.fleschutz.de"
}
param($URL = "http://www.fleschutz.de")
try {
Start-Process $URL

View File

@ -13,7 +13,7 @@ try {
for ([int]$i = 0; $i -lt $Percent; $i += 2) {
$obj.SendKeys([char]174) # each tick is -2%
}
write-host -foregroundColor green "✔️ turned volume down by $Percent %"
"🔉️ volume -$($Percent)%"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -13,7 +13,7 @@ try {
for ([int]$i = 0; $i -lt $Percent; $i += 2) {
$obj.SendKeys([char]175) # each tick is +2%
}
write-host -foregroundColor green "✔️ turned volume up by $Percent %"
"🔊️ volume +$($Percent)%"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX unmute-audio.ps1
.DESCRIPTION unmutes audio output
@ -9,7 +9,7 @@
try {
$obj = new-object -com wscript.shell
$obj.SendKeys([char]173)
write-host -foregroundColor green "Done"
"🔈 audio unmuted."
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX zip-dir.ps1 [<directory>]
.DESCRIPTION creates a zip archive of the given directory
@ -10,9 +10,10 @@ param($Directory = "")
if ($Directory -eq "" ) { $Directory = read-host "Enter the path to the directory to zip" }
try {
$Directory = resolve-path $Directory
compress-archive -path $Directory -destinationPath $Directory.zip
write-host -foregroundColor green "Done - created zip archive $($Directory).zip"
"✔️ zip archive created: $($Directory).zip"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"