mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 09:04:18 +01:00
Rename to list-timezone.ps1
This commit is contained in:
parent
370fe6c7dc
commit
9aa997ebf5
@ -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
|
||||
|
|
@ -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)
|
||||
|
@ -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])"
|
||||
|
@ -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])"
|
||||
|
@ -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
|
@ -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])"
|
||||
|
Loading…
Reference in New Issue
Block a user