Improved the scripts

This commit is contained in:
Markus Fleschutz 2021-02-16 19:06:18 +01:00
parent 92f759c1d4
commit 8001d120c6
5 changed files with 14 additions and 7 deletions

View File

@ -104,7 +104,7 @@ turn-volume-up.ps1, turns the audio volume up (+10% by default)
turn-volume-down.ps1, turns the audio volume down (-10% by default) turn-volume-down.ps1, turns the audio volume down (-10% by default)
txt2wav.ps1, converts text into a audio .WAV file txt2wav.ps1, converts text into a audio .WAV file
unmute-audio.ps1, unmutes audio unmute-audio.ps1, unmutes audio
update-repos.ps1, updates all Git repositories under the current directory update-repos.ps1, updates all Git repositories under the current/given directory
visualize-dir-tree.ps1, visualizes the given/current directory tree visualize-dir-tree.ps1, visualizes the given/current directory tree
voice-control.ps1, executes the PowerShell scripts by voice voice-control.ps1, executes the PowerShell scripts by voice
weather.ps1, prints the current weather forecast weather.ps1, prints the current weather forecast

1 Script Description
104 turn-volume-down.ps1 turns the audio volume down (-10% by default)
105 txt2wav.ps1 converts text into a audio .WAV file
106 unmute-audio.ps1 unmutes audio
107 update-repos.ps1 updates all Git repositories under the current directory updates all Git repositories under the current/given directory
108 visualize-dir-tree.ps1 visualizes the given/current directory tree
109 voice-control.ps1 executes the PowerShell scripts by voice
110 weather.ps1 prints the current weather forecast

View File

@ -110,7 +110,7 @@ Table of Contents
* [turn-volume-down.ps1](Scripts/turn-volume-down.ps1) - turns the audio volume down (-10% by default) * [turn-volume-down.ps1](Scripts/turn-volume-down.ps1) - turns the audio volume down (-10% by default)
* [txt2wav.ps1](Scripts/txt2wav.ps1) - converts text into a audio .WAV file * [txt2wav.ps1](Scripts/txt2wav.ps1) - converts text into a audio .WAV file
* [unmute-audio.ps1](Scripts/unmute-audio.ps1) - unmutes audio * [unmute-audio.ps1](Scripts/unmute-audio.ps1) - unmutes audio
* [update-repos.ps1](Scripts/update-repos.ps1) - updates all Git repositories under the current directory * [update-repos.ps1](Scripts/update-repos.ps1) - updates all Git repositories under the current/given directory
* [visualize-dir-tree.ps1](Scripts/visualize-dir-tree.ps1) - visualizes the given/current directory tree * [visualize-dir-tree.ps1](Scripts/visualize-dir-tree.ps1) - visualizes the given/current directory tree
* [voice-control.ps1](Scripts/voice-control.ps1) - executes the PowerShell scripts by voice * [voice-control.ps1](Scripts/voice-control.ps1) - executes the PowerShell scripts by voice
* [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast * [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast

View File

@ -8,6 +8,13 @@
param($URL = "") param($URL = "")
try {
& wget --version
} catch {
write-error "Can't execute 'wget' - make sure wget is installed and available"
exit 1
}
try { try {
if ($URL -eq "" ) { if ($URL -eq "" ) {
$URL = read-host "Enter URL to download" $URL = read-host "Enter URL to download"

View File

@ -1,7 +1,7 @@
#!/bin/powershell #!/bin/powershell
<# <#
.SYNTAX ./update-repos.ps1 [<directory>] .SYNTAX ./update-repos.ps1 [<directory>]
.DESCRIPTION updates all Git repositories under the current directory .DESCRIPTION updates all Git repositories under the current/given directory
.LINK https://github.com/fleschutz/PowerShell .LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0 .NOTES Author: Markus Fleschutz / License: CC0
#> #>
@ -19,10 +19,10 @@ try {
if ($Directory -eq "") { if ($Directory -eq "") {
$Directory = "$PWD" $Directory = "$PWD"
} }
$Items = get-childItem -path $Directory $Files = get-childItem -path $Directory
foreach ($Item in $Items) { foreach ($File in $Files) {
if ($Item.Mode -like "d*") { if ($File.Mode -like "d*") {
$Filename = $Item.Name $Filename = $File.Name
write-host "" write-host ""
write-host -nonewline "Updating $Filename ..." write-host -nonewline "Updating $Filename ..."
set-location $Filename set-location $Filename