serverspec/specinfra — pull request #81 by elmundio87 (2014-04-09 12:43:45+00:00)
Title: Block any powershell progress bar output

I was having issues with some tests consistently not passing even though they "should" be passing, and the test returned a successful exit code of "0".

From the console log;

````
...
$success = ((FindIISAppPool -name 'DefaultAppPool').managedRuntimeVersion -match 'v2.0')
if ($success -is [Boolean] -and $success) { $exitCode = 0 }
} catch {
Write-Output $_.Exception.Message
}
Write-Output "Exiting with code: $exitCode"
exit $exitCode
Exiting with code: 0

#< CLIXML

System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1 Completed-1
expected #has_dotnet_version?("2.0") to return true, got false
````

It seems that if powershell tries to showing a progress bar at some point during the test (as shown in the weird Powershell CLIXML output), the test fails. Changing the variable $ProgressPreference to "SilentlyContinue" will suppress the progress bar, which makes my failing tests pass.