From 1eb30ac221fa9e47d6dafc6e563aa7ca4b29764d Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 15 Jun 2023 11:30:47 +0200 Subject: [PATCH] Rename to write-clock.ps1 --- Scripts/display-time.ps1 | 31 ------------------------------- Scripts/on-desktop-login.ps1 | 1 + Scripts/write-clock.ps1 | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 31 deletions(-) delete mode 100755 Scripts/display-time.ps1 create mode 100755 Scripts/write-clock.ps1 diff --git a/Scripts/display-time.ps1 b/Scripts/display-time.ps1 deleted file mode 100755 index 66e990c2..00000000 --- a/Scripts/display-time.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -<# -.SYNOPSIS - Displays the current time -.DESCRIPTION - This PowerShell script displays the current time (for 10 seconds by default) -.PARAMETER Seconds - Specifies the number of seconds to display the time -.EXAMPLE - PS> ./display-time -.LINK - https://github.com/fleschutz/PowerShell -.NOTES - Author: Markus Fleschutz | License: CC0 -#> - -param([int]$Seconds = 10) - -try { - for ([int]$i = 0; $i -lt $Seconds; $i++) { - Clear-Host - Write-Output "" - $CurrentTime = Get-Date -format "yyyy-MM-dd HH:mm:ss" - ./write-big $CurrentTime - Write-Output "" - Start-Sleep -seconds 1 - } - exit 0 # success -} catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" - exit 1 -} diff --git a/Scripts/on-desktop-login.ps1 b/Scripts/on-desktop-login.ps1 index 05d60249..fd8a6f95 100644 --- a/Scripts/on-desktop-login.ps1 +++ b/Scripts/on-desktop-login.ps1 @@ -14,6 +14,7 @@ try { & "$PSScriptRoot/open-dashboards.ps1" & "$PSScriptRoot/open-windows-terminal.ps1" + & "$PSScriptRoot/write-clock.ps1" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/write-clock.ps1 b/Scripts/write-clock.ps1 new file mode 100755 index 00000000..6c2bb73e --- /dev/null +++ b/Scripts/write-clock.ps1 @@ -0,0 +1,29 @@ +<# +.SYNOPSIS + Writes an ASCII clock +.DESCRIPTION + This PowerShell script writes the current time as ACSII clock +.EXAMPLE + PS> ./write-clock +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + for ([int]$i = 0; $i -lt 99999; $i++) { + Clear-Host + Write-Output "" + $Date = Get-Date -format "yyyy-MM-dd" + $Time = Get-Date -format "HH:mm:ss" + & "$PSScriptRoot/write-big.ps1" $Date + & "$PSScriptRoot/write-big.ps1" $Time + Write-Output "" + Start-Sleep -seconds 1 + } + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}