From cd5612a2827d75f59419ddca8afba61d748cbc67 Mon Sep 17 00:00:00 2001 From: Steven Judd Date: Fri, 15 May 2020 22:14:08 -0500 Subject: [PATCH] convert to function update name of inline function to avoid unapproved verb renamed file to match function name updated examples --- Digital Clock.ps1 | 303 -------------------------------- Start-DigitalClock-Function.ps1 | 273 ++++++++++++++++++++++++++++ 2 files changed, 273 insertions(+), 303 deletions(-) delete mode 100644 Digital Clock.ps1 create mode 100644 Start-DigitalClock-Function.ps1 diff --git a/Digital Clock.ps1 b/Digital Clock.ps1 deleted file mode 100644 index d2e05ec..0000000 --- a/Digital Clock.ps1 +++ /dev/null @@ -1,303 +0,0 @@ -#requires -version 3 - -<# -.SYNOPSIS - -Display digitial clock with granularity in seconds or a stopwatch in a window with ability to stop/start - -.PARAMETER stopwatch - -Run a stopwatch rather than showing current time - -.PARAMETER start - -Start the stopwatch immediately - -.PARAMETER notOnTop - -Do not place the window on top of all other windows - -.PARAMETER markerFile - -A file to look for which will be then seen in a SysInternals Process Monitor trace as a CreateFile operation to allow cross referencing to that - -.EXAMPLE - -& '.\Digital Clock.ps1' - -Display an updating digital clock in a window - -.EXAMPLE - -& '.\Digital Clock.ps1' -stopwatch - -Display a stopwatch in a window but do not start it until the Run checkbox is checked - -.EXAMPLE - -& '.\Digital Clock.ps1' -stopwatch -start - -Display a stopwatch in a window and start it immediately - -.NOTES - - Modification History: - - @guyrleech 14/05/2020 Initial release - Rewrote to use WPF DispatcherTimer rather than runspaces - Added marker functionality - @guyrleech 15/05/2020 Pressing C puts existing marker items onto the Windows clipboard -#> - -[CmdletBinding()] - -Param -( - [switch]$stopWatch , - [switch]$start , - [string]$markerFile , - [switch]$notOnTop -) - -[int]$exitCode = 0 - - -[string]$mainwindowXAML = @' - - - - - -