mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-31 19:26:27 +02:00
Merge branch 'master' of github.com:fleschutz/PowerShell
This commit is contained in:
commit
eef59091ed
@ -262,38 +262,38 @@ open-videos-folder.ps1, ,Opens the user's videos folder,
|
||||
open-windows-terminal.ps1, ,Launches Windows Terminal,
|
||||
open-wikipedia.ps1, ,Opens Wikipedia's website,
|
||||
open-youtube.ps1, ,Opens YouTube.com,
|
||||
pick-commit.ps1, ,Cherry-picks a Git commit into multiple branches,
|
||||
pick-commit.ps1,git,Cherry-picks a Git commit into multiple branches,
|
||||
ping-weather.ps1, ,Ping the currrent weather conditions,
|
||||
play-bee-sound.ps1, ,"Plays a bee sound",
|
||||
play-beep-sound.ps1, ,"Plays a short beep sound",
|
||||
play-cat-sound.ps1, ,"Plays a cat sound",
|
||||
play-cow-sound.ps1, ,"Plays a cow sound",
|
||||
play-dog-sound.ps1, ,"Plays a dog sound",
|
||||
play-donkey-sound.ps1, ,"Plays a donkey sound",
|
||||
play-elephant-sound.ps1, ,"Plays an elephant sound",
|
||||
play-elk-sound.ps1, ,"Plays an elk sound",
|
||||
play-files.ps1, ,"Plays audio files (MP3 and WAV)",
|
||||
play-frog-sound.ps1, ,"Plays a frog sound",
|
||||
play-goat-sound.ps1, ,"Plays a goat sound",
|
||||
play-gorilla-sound.ps1, ,"Plays a gorilla sound",
|
||||
play-happy-birthday.ps1, ,"Plays the Happy Birthday song",
|
||||
play-horse-sound.ps1, ,"Plays a horse sound",
|
||||
play-imperial-march.ps1, ,"Plays the Imperial March (Star Wars)",
|
||||
play-jingle-bells.ps1, ,"Plays Jingle Bells",
|
||||
play-lion-sound.ps1, ,"Plays a lion sound",
|
||||
play-m3u.ps1, ,"Plays a playlist (.M3U format)",
|
||||
play-mission-impossible.ps1, ,"Plays the Mission Impossible theme",
|
||||
play-mp3.ps1, ,"Plays a MP3 sound file",
|
||||
play-parrot-sound.ps1, ,"Plays a parrot sound",
|
||||
play-pig-sound.ps1, ,"Plays a pig sound",
|
||||
play-pong.ps1, ,"play-pong.ps1",
|
||||
play-rattlesnake-sound.ps1, ,"Plays a rattlesnake sound",
|
||||
play-rick.ps1, ,"Plays Rick Astley",
|
||||
play-snake.ps1, ,"Play the Snake game",
|
||||
play-super-mario.ps1, ,"Plays the Super Mario intro",
|
||||
play-tetris-melody.ps1, ,"Plays the Tetris melody",
|
||||
play-vulture-sound.ps1, ,"Plays a vulture sound",
|
||||
play-wolf-sound.ps1, ,"Plays a wolf sound",
|
||||
play-bee-sound.ps1,audio,"Plays a bee sound",
|
||||
play-beep-sound.ps1,audio,"Plays a short beep sound",
|
||||
play-cat-sound.ps1,audio,"Plays a cat sound",
|
||||
play-cow-sound.ps1,audio,"Plays a cow sound",
|
||||
play-dog-sound.ps1,audio,"Plays a dog sound",
|
||||
play-donkey-sound.ps1,audio,"Plays a donkey sound",
|
||||
play-elephant-sound.ps1,audio,"Plays an elephant sound",
|
||||
play-elk-sound.ps1,audio,"Plays an elk sound",
|
||||
play-files.ps1,audio,"Plays audio files (MP3 and WAV)",
|
||||
play-frog-sound.ps1,audio,"Plays a frog sound",
|
||||
play-goat-sound.ps1,audio,"Plays a goat sound",
|
||||
play-gorilla-sound.ps1,audio,"Plays a gorilla sound",
|
||||
play-happy-birthday.ps1,audio,"Plays the Happy Birthday song",
|
||||
play-horse-sound.ps1,audio,"Plays a horse sound",
|
||||
play-imperial-march.ps1,audio,"Plays the Imperial March (Star Wars)",
|
||||
play-jingle-bells.ps1,audio,"Plays Jingle Bells",
|
||||
play-lion-sound.ps1,audio,"Plays a lion sound",
|
||||
play-m3u.ps1,audio,"Plays a playlist (.M3U format)",
|
||||
play-mission-impossible.ps1,audio,"Plays the Mission Impossible theme",
|
||||
play-mp3.ps1,audio,"Plays a MP3 sound file",
|
||||
play-parrot-sound.ps1,audio,"Plays a parrot sound",
|
||||
play-pig-sound.ps1,audio,"Plays a pig sound",
|
||||
play-pong.ps1,game,"play-pong.ps1",
|
||||
play-rattlesnake-sound.ps1,audio,"Plays a rattlesnake sound",
|
||||
play-rick.ps1,fun,"Plays Rick Astley",
|
||||
play-snake.ps1,game,"Play the Snake game",
|
||||
play-super-mario.ps1,audio,"Plays the Super Mario intro",
|
||||
play-tetris-melody.ps1,audio,"Plays the Tetris melody",
|
||||
play-vulture-sound.ps1,audio,"Plays a vulture sound",
|
||||
play-wolf-sound.ps1,audio,"Plays a wolf sound",
|
||||
poweroff.ps1, ,Halts the local computer (needs admin rights),
|
||||
publish-to-ipfs.ps1, ,Publishes the given files or directory to IPFS,
|
||||
pull-repo.ps1,git,Pulls updates for the current/given Git repository (including submodules),
|
||||
|
|
@ -23,49 +23,58 @@ function GetTempDir {
|
||||
return "C:\Temp"
|
||||
}
|
||||
|
||||
function AddLine { param([string]$FolderName, [string]$FolderPath)
|
||||
if (Test-Path "$FolderPath" -pathType container) {
|
||||
New-Object PSObject -property @{ 'Folder Name' = "$FolderName"; 'Folder Path' = "📂$FolderPath" }
|
||||
function TryFolder([string]$name, [string]$path) {
|
||||
if (Test-Path "$path" -pathType container) {
|
||||
New-Object PSObject -property @{ 'Folder Name' = "$name"; 'Folder Path' = "📂$path" }
|
||||
}
|
||||
}
|
||||
|
||||
function ListSpecialFolders {
|
||||
if ($IsLinux) {
|
||||
AddLine "Desktop" "$HOME/Desktop/"
|
||||
AddLine "Documents" "$HOME/Documents/"
|
||||
AddLine "Downloads" "$HOME/Downloads/"
|
||||
AddLine "Dropbox" "$HOME/Dropbox/"
|
||||
AddLine "Home" "$HOME/"
|
||||
AddLine "Music" "$HOME/Music/"
|
||||
AddLine "Pictures" "$HOME/Pictures/"
|
||||
AddLine "Repositories" "$HOME/Repos/"
|
||||
AddLine "Repositories" "$HOME/Repositories/"
|
||||
AddLine "Screenshots" "$HOME/Pictures/Screenshots/"
|
||||
AddLine "Snap" "$HOME/snap/"
|
||||
AddLine "SSH" "$HOME/.ssh/"
|
||||
AddLine "Trash" "$HOME/.local/share/Trash/"
|
||||
AddLine "Templates" "$Home/Templates/"
|
||||
AddLine "Temporary" "$(GetTempDir)"
|
||||
TryFolder "Boot files" "/boot"
|
||||
TryFolder "Config files" "/etc"
|
||||
TryFolder "Desktop" "$HOME/Desktop"
|
||||
TryFolder "Device files" "/dev"
|
||||
TryFolder "Documents" "$HOME/Documents"
|
||||
TryFolder "Downloads" "$HOME/Downloads"
|
||||
TryFolder "Dropbox" "$HOME/Dropbox"
|
||||
TryFolder "Home" "$HOME"
|
||||
TryFolder "Mount points" "/mnt"
|
||||
TryFolder "Music" "$HOME/Music"
|
||||
TryFolder "Optional packages" "/opt"
|
||||
TryFolder "Pictures" "$HOME/Pictures"
|
||||
TryFolder "Recovered files" "/lost+found"
|
||||
TryFolder "Removable media" "/media"
|
||||
TryFolder "Repositories" "$HOME/Repos"
|
||||
TryFolder "Repositories" "$HOME/Repositories"
|
||||
TryFolder "Root" "/"
|
||||
TryFolder "Screenshots" "$HOME/Pictures/Screenshots"
|
||||
TryFolder "Snap" "$HOME/snap"
|
||||
TryFolder "SSH" "$HOME/.ssh"
|
||||
TryFolder "System binaries" "/sbin"
|
||||
TryFolder "Trash" "$HOME/.local/share/Trash"
|
||||
TryFolder "Templates" "$Home/Templates"
|
||||
TryFolder "Temporary" "$(GetTempDir)"
|
||||
$Path = Resolve-Path "$HOME/.."
|
||||
AddLine "Users" "$Path/"
|
||||
AddLine "Videos" "$HOME/Videos/"
|
||||
TryFolder "Users" "$Path"
|
||||
TryFolder "Videos" "$HOME/Videos"
|
||||
} else {
|
||||
$FolderNames = [System.Enum]::GetNames('System.Environment+SpecialFolder')
|
||||
$FolderNames | Sort-Object | ForEach-Object {
|
||||
if ($Path = [System.Environment]::GetFolderPath($_)) {
|
||||
AddLine "$_" "$Path"
|
||||
TryFolder "$_" "$Path"
|
||||
}
|
||||
}
|
||||
AddLine "Repositories" "$HOME\source\repos"
|
||||
AddLine "SSH" "$HOME\.ssh"
|
||||
AddLine "Temporary" "$(GetTempDir)"
|
||||
TryFolder "Repositories" "$HOME\source\repos"
|
||||
TryFolder "SSH" "$HOME\.ssh"
|
||||
TryFolder "Temporary" "$(GetTempDir)"
|
||||
$Path = Resolve-Path "$HOME/.."
|
||||
AddLine "Users" "$Path"
|
||||
TryFolder "Users" "$Path"
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
ListSpecialFolders | Format-Table -property @{e='Folder Name';width=18},'Folder Path'
|
||||
ListSpecialFolders | Format-Table -property @{e='Folder Name';width=19},'Folder Path'
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user