21 lines
534 B
PowerShell
21 lines
534 B
PowerShell
|
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
|
||
|
}
|