ps/Modules/Cole.PowerShell.Developer/Public/Trace-ActionEnd.ps1

21 lines
534 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Trace-ActionEnd {
<#
.SYNOPSIS
End tracing the action. This is useful for gathering duration of runtime.
.PARAMETER TraceAction
Object returned from Trace-ActionStart
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[object]$TraceAction
)
$TraceAction.StopWatch.Stop()
$TraceAction.EndTime = [System.DateTime]::Now
$TraceAction.Duration = $TraceAction.StopWatch.Elapsed
$global:TraceActionList.Add($TraceAction) | Out-Null
}