Added linenumber support to measure just a section of a script or file.

This commit is contained in:
KevinMarquette
2017-02-05 12:13:59 -08:00
parent bbb7cd508d
commit 207b60fa00
3 changed files with 26 additions and 3 deletions

View File

@@ -15,6 +15,10 @@ function Get-Chronometer
[string[]]
$Path,
# Line numbers within the script file to measure
[int[]]
$LineNumber = $null,
# The script to start the scrupt or execute other commands
[alias('Script','CommandScript')]
[scriptblock]
@@ -24,7 +28,7 @@ function Get-Chronometer
$Chronometer = [Chronometer]::New()
Write-Verbose "Setting breapoints"
$Chronometer.AddBreakpoint($Path)
$Chronometer.AddBreakpoint($Path,$LineNumber)
if($Chronometer.breakPoint -ne $null)
{