Skip to content

Instantly share code, notes, and snippets.

Created April 21, 2015 13:44
What would you like to do?
function Start-Timer {
Set the global timerStart variable.
Start-Timer -Silent
Will set the variable, and not output anything
Write-Verbose (Start-Timer)
Will set the variable, and write the start time to the verbose stream.
Author: Øyvind Kallstad
Date: 19.04.2015
Version: 1.0
param (
# Do not output anything.
[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