mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-20 17:08:19 +02:00
Add unicode character
This commit is contained in:
parent
76e6cc1118
commit
370fe6c7dc
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX list-clipboard.ps1
|
.SYNTAX list-clipboard.ps1
|
||||||
.DESCRIPTION lists the contents of the clipboard
|
.DESCRIPTION lists the contents of the clipboard
|
||||||
@ -7,7 +7,7 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
get-clipboard
|
"📋 $(get-clipboard)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX list-commits.ps1 [<repo-dir>] [<format>]
|
.SYNTAX list-commits.ps1 [<repo-dir>] [<format>]
|
||||||
.DESCRIPTION lists all commits in the current/given Git repository
|
.DESCRIPTION lists all commits in the current/given Git repository
|
||||||
@ -32,6 +32,6 @@ try {
|
|||||||
write-output ""
|
write-output ""
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "⚠️ ERROR: $($Error[0]) (line $($_.InvocationInfo.ScriptLineNumber))"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX list-earthquakes.ps1
|
.SYNTAX list-earthquakes.ps1
|
||||||
.DESCRIPTION lists earthquakes with magnitude >= 6.0 for the last 30 days
|
.DESCRIPTION lists earthquakes with magnitude >= 6.0 for the last 30 days
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX list-tags.ps1 [<repo-dir>] [<pattern>]
|
.SYNTAX list-tags.ps1 [<repo-dir>] [<pattern>]
|
||||||
.DESCRIPTION lists all tags in the current/given Git repository
|
.DESCRIPTION lists all tags in the current/given Git repository
|
||||||
@ -9,8 +9,6 @@
|
|||||||
param($RepoDir = "$PWD", $Pattern="*")
|
param($RepoDir = "$PWD", $Pattern="*")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
write-output "Fetching updates for Git repository $RepoDir ..."
|
|
||||||
|
|
||||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||||
set-location "$RepoDir"
|
set-location "$RepoDir"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX mute-audio.ps1
|
.SYNTAX mute-audio.ps1
|
||||||
.DESCRIPTION mutes the audio
|
.DESCRIPTION mutes the audio
|
||||||
@ -9,8 +9,7 @@
|
|||||||
try {
|
try {
|
||||||
$obj = new-object -com wscript.shell
|
$obj = new-object -com wscript.shell
|
||||||
$obj.SendKeys([char]173)
|
$obj.SendKeys([char]173)
|
||||||
|
"🔇 audio muted."
|
||||||
write-host -foregroundColor green "Done."
|
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX open-browser.ps1 [<URL>]
|
.SYNTAX open-browser.ps1 [<URL>]
|
||||||
.DESCRIPTION starts the default Web browser, optional with given URL
|
.DESCRIPTION starts the default Web browser, optional with given URL
|
||||||
@ -6,11 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param($URL = "")
|
param($URL = "http://www.fleschutz.de")
|
||||||
|
|
||||||
if ($URL -eq "" ) {
|
|
||||||
$URL = "http://www.fleschutz.de"
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Start-Process $URL
|
Start-Process $URL
|
||||||
|
@ -13,7 +13,7 @@ try {
|
|||||||
for ([int]$i = 0; $i -lt $Percent; $i += 2) {
|
for ([int]$i = 0; $i -lt $Percent; $i += 2) {
|
||||||
$obj.SendKeys([char]174) # each tick is -2%
|
$obj.SendKeys([char]174) # each tick is -2%
|
||||||
}
|
}
|
||||||
write-host -foregroundColor green "✔️ turned volume down by $Percent %"
|
"🔉️ volume -$($Percent)%"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -13,7 +13,7 @@ try {
|
|||||||
for ([int]$i = 0; $i -lt $Percent; $i += 2) {
|
for ([int]$i = 0; $i -lt $Percent; $i += 2) {
|
||||||
$obj.SendKeys([char]175) # each tick is +2%
|
$obj.SendKeys([char]175) # each tick is +2%
|
||||||
}
|
}
|
||||||
write-host -foregroundColor green "✔️ turned volume up by $Percent %"
|
"🔊️ volume +$($Percent)%"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX unmute-audio.ps1
|
.SYNTAX unmute-audio.ps1
|
||||||
.DESCRIPTION unmutes audio output
|
.DESCRIPTION unmutes audio output
|
||||||
@ -9,7 +9,7 @@
|
|||||||
try {
|
try {
|
||||||
$obj = new-object -com wscript.shell
|
$obj = new-object -com wscript.shell
|
||||||
$obj.SendKeys([char]173)
|
$obj.SendKeys([char]173)
|
||||||
write-host -foregroundColor green "Done"
|
"🔈 audio unmuted."
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX zip-dir.ps1 [<directory>]
|
.SYNTAX zip-dir.ps1 [<directory>]
|
||||||
.DESCRIPTION creates a zip archive of the given 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" }
|
if ($Directory -eq "" ) { $Directory = read-host "Enter the path to the directory to zip" }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$Directory = resolve-path $Directory
|
||||||
compress-archive -path $Directory -destinationPath $Directory.zip
|
compress-archive -path $Directory -destinationPath $Directory.zip
|
||||||
|
|
||||||
write-host -foregroundColor green "Done - created zip archive $($Directory).zip"
|
"✔️ zip archive created: $($Directory).zip"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user