This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-Timer { | |
<# | |
.SYNOPSIS | |
Set the global timerStart variable. | |
.EXAMPLE | |
Start-Timer -Silent | |
Will set the variable, and not output anything | |
.EXAMPLE | |
Write-Verbose (Start-Timer) | |
Will set the variable, and write the start time to the verbose stream. | |
.NOTES | |
Author: Øyvind Kallstad | |
Date: 19.04.2015 | |
Version: 1.0 | |
#> | |
[CmdletBinding()] | |
param ( | |
# Do not output anything. | |
[Parameter()] | |
[switch] $Silent = $false | |
) | |
$global:timerStart = Get-Date | |
if (-not($Silent)) { | |
Write-Output $global:timerStart | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment