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

@@ -17,6 +17,17 @@ Describe "Basic unit tests" -Tags Build {
$results = Get-Chronometer -Path $PSScriptRoot\..\ScratchFiles\example.ps1 -Script {. "$PSScriptRoot\..\ScratchFiles\example.ps1"}
$results | Should Not BeNullOrEmpty
}
it "Executes a script with linenumbers and gives results" {
# Get-Chronometer -Path ScratchFiles\example.ps1 -Script {"Test"}
$params = @{
Path = "$PSScriptRoot\..\ScratchFiles\example.ps1"
Script = {. "$PSScriptRoot\..\ScratchFiles\example.ps1"}
LineNumber = 2,3,5,6
}
$results = Get-Chronometer @params
$results | Should Not BeNullOrEmpty
}
}
Context "Function: Format-Chronometer" {