Rename to list-timezone.ps1

This commit is contained in:
Markus Fleschutz 2021-04-17 18:38:38 +02:00
parent 370fe6c7dc
commit 9aa997ebf5
6 changed files with 19 additions and 27 deletions

View File

@ -67,7 +67,6 @@ list-automatic-variables.ps1, lists the automatic variables of PowerShell
list-branches.ps1, lists all branches in the current/given Git repository
list-cheat-sheet.ps1, lists the PowerShell cheat sheet
list-commits.ps1, lists all commits in the current/given Git repository
list-current-timezone.ps1, lists the current time zone details
list-clipboard.ps1, lists the contents of the clipboard
list-dir-tree.ps1, lists a directory tree
list-drives.ps1, lists all drives
@ -101,6 +100,7 @@ list-sql-tables.ps1, lists the SQL server tables
list-system-info.ps1, lists system information on the local computer
list-tags.ps1, lists all tags in the current/given Git repository
list-tasks.ps1, lists all Windows scheduler tasks
list-timezone.ps1, lists the current time zone details
list-timezones.ps1, lists all time zones available
list-user-groups.ps1, lists the user groups on the local computer
locate-city.ps1, prints the geographic location of the given city

1 Script Description
67 list-branches.ps1 lists all branches in the current/given Git repository
68 list-cheat-sheet.ps1 lists the PowerShell cheat sheet
69 list-commits.ps1 lists all commits in the current/given Git repository
list-current-timezone.ps1 lists the current time zone details
70 list-clipboard.ps1 lists the contents of the clipboard
71 list-dir-tree.ps1 lists a directory tree
72 list-drives.ps1 lists all drives
100 list-system-info.ps1 lists system information on the local computer
101 list-tags.ps1 lists all tags in the current/given Git repository
102 list-tasks.ps1 lists all Windows scheduler tasks
103 list-timezone.ps1 lists the current time zone details
104 list-timezones.ps1 lists all time zones available
105 list-user-groups.ps1 lists the user groups on the local computer
106 locate-city.ps1 prints the geographic location of the given city

View File

@ -46,7 +46,6 @@ Mega Collection of PowerShell Scripts
* [install-google-chrome.ps1](Scripts/install-google-chrome.ps1) - installs the Google Chrome browser
* [list-drives.ps1](Scripts/list-drives.ps1) - lists all drives
* [list-network-shares.ps1](Scripts/list-network-shares.ps1) - lists the network shares of the local computer
* [list-current-timezone.ps1](Scripts/list-current-timezone.ps1) - lists the current time zone details
* [list-installed-apps.ps1](Scripts/list-installed-apps.ps1) - lists the installed Windows Store apps
* [list-installed-software.ps1](Scripts/list-installed-software.ps1) - lists the installed software (except Windows Store apps)
* [list-printers.ps1](Scripts/list-printers.ps1) - lists all printer known to the computer
@ -54,6 +53,7 @@ Mega Collection of PowerShell Scripts
* [list-services.ps1](Scripts/list-services.ps1) - lists the services on the local computer
* [list-system-info.ps1](Scripts/list-system-info.ps1) - lists system information on the local computer
* [list-tasks.ps1](Scripts/list-tasks.ps1) - lists all Windows scheduler tasks
* [list-timezone.ps1](Scripts/list-timezone.ps1) - lists the current time zone details
* [list-timezones.ps1](Scripts/list-timezones.ps1) - lists all time zones available
* [list-user-groups.ps1](Scripts/list-user-groups.ps1) - lists the user groups on the local computer
* [poweroff.ps1](Scripts/poweroff.ps1) - halts the local computer (needs admin rights)

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX list-empty-dirs.ps1 [<dir-tree>]
.DESCRIPTION lists empty subfolders within the given directory tree
@ -6,20 +6,17 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($DirTree = "")
if ($DirTree -eq "" ) {
$DirTree = read-host "Enter the path to the directory tree"
}
param($DirTree = "$PWD")
try {
$DirTree = resolve-path "$DirTree/"
write-progress "Listing empty directories in $DirTree..."
[int]$Count = 0
Get-ChildItem $DirTree -attributes Directory -recurse | Where {$_.GetFileSystemInfos().Count -eq 0} | ForEach-Object {
write-output $_.FullName
Get-ChildItem "$DirTree" -attributes Directory -recurse | Where {$_.GetFileSystemInfos().Count -eq 0} | ForEach-Object {
"📂 $($_.FullName)"
$Count++
}
write-host -foregroundColor green "OK - found $Count empty directories"
"✔️ directory tree $DirTree has $Count empty directories"
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-hidden-files.ps1 [<dir-tree>]
.DESCRIPTION lists hidden files within the given directory tree
@ -6,20 +6,17 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($DirTree = "")
if ($DirTree -eq "" ) {
$DirTree = read-host "Enter the path to the directory tree"
}
param($DirTree = "$PWD")
try {
$DirTree = resolve-path "$DirTree/"
[int]$Count = 0
write-progress "Listing hidden files in $DirTree ..."
get-childItem $DirTree -attributes Hidden -recurse | foreach-object {
write-output $_.FullName
get-childItem "$DirTree" -attributes Hidden -recurse | foreach-object {
"📄 $($_.FullName)"
$Count++
}
write-host -foregroundColor green "OK - found $Count hidden file(s)"
"✔️ directory tree $DirTree has $Count hidden file(s)"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -1,6 +1,6 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX list-current-timezone.ps1
.SYNTAX list-timezone.ps1
.DESCRIPTION lists the details of the current time zone
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX next-joke.ps1
.DESCRIPTION gets the next random Juck Norris joke
@ -7,15 +7,13 @@
#>
try {
$PathToRepo = "$PSScriptRoot/.."
$Table = import-csv "$PathToRepo/Data/jokes.csv"
$Table = import-csv "$PSScriptRoot/../Data/jokes.csv"
$Generator = New-Object System.Random
$Index = [int]$Generator.next(0,66)
$Joke = $Table[$Index].Joke
write-output "$Joke"
"📣 $Joke"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"