Add new debugging tests which are based on existing earlier non-Pester tests

This commit is contained in:
James Truher committed 2016-08-30 16:15:10 -07:00
1 parent d3a177d6ae
commit 9c99bdbef9
2 files changed
+121

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
function Wait-CompleteExecution
{
[CmdletBinding()]
param (
[ScriptBlock]$sb,
[int]$TimeoutInMilliseconds = 10000,
[int]$IntervalInMilliseconds = 1000
)
# Get the current time
$startTime = [DateTime]::Now
# Loop until the script block evaluates to true
while (-not ($sb.Invoke())) {
# Sleep for the specified interval
start-sleep -mil $intervalInMilliseconds
# If the timeout period has passed, throw an exception
if (([DateTime]::Now - $startTime).TotalMilliseconds -gt $timeoutInMilliseconds)
{
return $false
}
}
return $true
}
export-modulemember -function Wait-CompleteExecution