Skip to content

Instantly share code, notes, and snippets.

@Staggerlee011
Created October 26, 2017 09:43
Show Gist options
  • Save Staggerlee011/4a339dcce8224b2f94676e8735b6061c to your computer and use it in GitHub Desktop.
Save Staggerlee011/4a339dcce8224b2f94676e8735b6061c to your computer and use it in GitHub Desktop.
$env:ServerName = "MyServer"
$env:JenkinsUser = "domain\login"
$env:JenkinsPassword = "SuperSecretPassword"
## Ivoke OS Pester test output to OSreport.xml
Invoke-Pester -Script @{Path ='C:\GIT\DBA\Build\Pester\SQL Server OS.test.ps1'; Parameters = @{ServerName = $($env:ServerName); JenkinsUser = $($env:JenkinsUser) ; JenkinsPassword = $($env:JenkinsPassword)}} -OutputFile OSreport.xml -OutputFormat NUnitXml
## Push data into SQL Server via DBATools
$output = Parse-PesterXML -XMLFile ./OSreport.xml -Server $env:ServerName | Out-DbaDataTable
Write-DbaDataTable -SqlServer PRD-SQL-INT01 -InputObject $output -Table admin.dbo.pesterresults -AutoCreateTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment