Added go-home.ps1, go-downloads.ps1, and go-music.ps1

This commit is contained in:
Markus Fleschutz 2021-02-26 14:41:07 +01:00
parent 57bde59bce
commit 33f5b5b408
8 changed files with 54 additions and 3 deletions

View File

@ -29,6 +29,9 @@ enable-crash-dumps.ps1, enables the writing of crash dumps
encrypt-file.ps1, encrypts the given file
fetch-repos.ps1, fetches all Git repositories under the current/given directory (including submodules)
generate-qrcode.ps1, generates a QR code
go-downloads.ps1, go to the user's downloads folder
go-home.ps1, go to the user's home folder
go-music.ps1, go to the user's music folder
hibernate.ps1, enables hibernate mode for the local computer (requires admin rights)
inspect-exe.ps1, prints basic information of the given executable file
list-anagrams.ps1, lists all anagrams of the given word

1 Script Description
29 encrypt-file.ps1 encrypts the given file
30 fetch-repos.ps1 fetches all Git repositories under the current/given directory (including submodules)
31 generate-qrcode.ps1 generates a QR code
32 go-downloads.ps1 go to the user's downloads folder
33 go-home.ps1 go to the user's home folder
34 go-music.ps1 go to the user's music folder
35 hibernate.ps1 enables hibernate mode for the local computer (requires admin rights)
36 inspect-exe.ps1 prints basic information of the given executable file
37 list-anagrams.ps1 lists all anagrams of the given word

View File

@ -1,7 +1,7 @@
Collection of PowerShell Scripts
================================
**This repository contains 130+ useful and cross-platform PowerShell scripts in the [Scripts/ folder](Scripts/) - to be used by command-line interface (CLI), for remote control (RC), by context menu, by voice control, by automation software like Jenkins, automatically as daily tasks, or simply to learn PowerShell. See the [FAQ page](Misc/FAQ.md) if you need help or have any questions.**
**This repository contains 140+ useful and cross-platform PowerShell scripts in the [Scripts/ folder](Scripts/) - to be used by command-line interface (CLI), for remote control (RC), by context menu, by voice control, by automation software like Jenkins, automatically as daily tasks, or simply to learn PowerShell. See the [FAQ page](Misc/FAQ.md) if you need help or have any questions.**
Scripts for Audio & Voice 🔊
---------------------------
@ -74,6 +74,9 @@ Scripts for Files & Folders 📁
* [create-symlink.ps1](Scripts/create-symlink.ps1) - creates a symbolic link
* [decrypt-file.ps1](Scripts/decrypt-file.ps1) - encrypts the given file
* [encrypt-file.ps1](Scripts/encrypt-file.ps1) - encrypts the given file
* [go-downloads.ps1](Scripts/go-downloads.ps1) - go to the user's downloads folder
* [go-home.ps1](Scripts/go-home.ps1) - go to the user's home folder
* [go-music.ps1](Scripts/go-music.ps1) - go to the user's music folder
* [inspect-exe.ps1](Scripts/inspect-exe.ps1) - prints basic information of the given executable file
* [list-empty-dirs.ps1](Scripts/list-empty-dirs.ps1) - lists empty subfolders within the given directory tree
* [list-empty-files.ps1](Scripts/list-empty-files.ps1) - lists empty files within the given directory tree

15
Scripts/go-downloads.ps1 Executable file
View File

@ -0,0 +1,15 @@
#!/bin/powershell
<#
.SYNTAX ./go-downloads.ps1
.DESCRIPTION go to the user's downloads folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
set-location $HOME/Downloads/
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

15
Scripts/go-home.ps1 Executable file
View File

@ -0,0 +1,15 @@
#!/bin/powershell
<#
.SYNTAX ./go-home.ps1
.DESCRIPTION go to the user's home folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
set-location $HOME
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

15
Scripts/go-music.ps1 Executable file
View File

@ -0,0 +1,15 @@
#!/bin/powershell
<#
.SYNTAX ./go-music.ps1
.DESCRIPTION go to the user's music folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
set-location $HOME/Music/
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -66,7 +66,7 @@ try {
$Vars = ListAutomaticVariables
$Vars | format-table -property Variable,Content
write-host -foregroundColor green "OK - $($Vars.Count) automatic variables total"
write-host -foregroundColor green "OK - $($Vars.Count) PowerShell automatic variables total"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

0
Scripts/my-profile.ps1 Normal file → Executable file
View File

View File

@ -12,7 +12,7 @@ try {
copy-item "$PathToRepo/Scripts/my-profile.ps1" "$PathToProfile" -force
write-host -foregroundColor green "OK - updated profile 'CurrentUserCurrentHost' (gets active on next login)"
write-host -foregroundColor green "OK - updated profile 'CurrentUserCurrentHost', gets active on next login"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"