Skip to content

Instantly share code, notes, and snippets.

@elderfo
Last active August 11, 2020 11:34
Show Gist options
  • Save elderfo/4c8da595c30f4347b27c5e4d23ed2758 to your computer and use it in GitHub Desktop.
Save elderfo/4c8da595c30f4347b27c5e4d23ed2758 to your computer and use it in GitHub Desktop.
Install TC VS Test Logger
$zipFile = "$($env:TEMP)\TeamCity.VSTest.TestLogger.zip"
$zipOutput = "$($env:TEMP)\TeamCity.VSTest.TestLogger"
$loggerPath = "$($zipOutput)\vstest15"
$vsTestExtensions = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\TestPlatform\Extensions"
try {
Invoke-WebRequest -Uri "http://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:TeamCityPluginsByJetBrains_TeamCityVSTestTestAdapter_Build,pinned:true,status:SUCCESS,branch:master,tags:release/artifacts/content/TeamCity.VSTest.TestLogger.zip" -OutFile $zipFile
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $zipOutput)
Copy-Item -Path "$($loggerPath)\*" -Destination $vsTestExtensions
} finally {
If (Test-Path $zipOutput){
Remove-Item $zipOutput -Force -Recurse
}
If (Test-Path $zipFile){
Remove-Item $zipFile -Force
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment