@@ -275,11 +275,10 @@ function Start-ScriptAnalyzerBuild
275
275
$framework ,
276
276
" --configuration" ,
277
277
" $buildConfiguration "
278
- if ( $env: InVSTS ) {
278
+ if ( $env: TF_BUILD ) {
279
279
$dotnetArgs += " --output"
280
280
$dotnetArgs += " ${PSScriptRoot} \bin\${buildConfiguration} \${framework} "
281
281
}
282
- # $buildOutput = & $script:DotnetExe build --framework $framework --configuration "$buildConfiguration" 2>&1
283
282
$buildOutput = & $script :DotnetExe $dotnetArgs 2>&1
284
283
if ( $LASTEXITCODE -ne 0 ) { throw " $buildOutput " }
285
284
Write-Verbose - Verbose:$verboseWanted - message " $buildOutput "
@@ -295,7 +294,7 @@ function Start-ScriptAnalyzerBuild
295
294
296
295
Publish-File $itemsToCopyCommon $script :destinationDir
297
296
298
- if ( $env: InVsts ) {
297
+ if ( $env: TF_BUILD ) {
299
298
$itemsToCopyBinaries = @ (
300
299
" $projectRoot \bin\${buildConfiguration} \${Framework} \Microsoft.Windows.PowerShell.ScriptAnalyzer.dll" ,
301
300
" $projectRoot \bin\${buildConfiguration} \${Framework} \Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll"
@@ -315,7 +314,7 @@ function Start-ScriptAnalyzerBuild
315
314
Publish-File $settingsFiles (Join-Path - Path $script :destinationDir - ChildPath Settings)
316
315
317
316
if ($framework -eq ' net452' ) {
318
- if ( $env: InVSTS ) {
317
+ if ( $env: TF_BUILD ) {
319
318
$nsoft = " $projectRoot \bin\${buildConfiguration} \${framework} \Newtonsoft.Json.dll"
320
319
}
321
320
else {
@@ -330,9 +329,8 @@ function Start-ScriptAnalyzerBuild
330
329
331
330
function New-Catalog
332
331
{
333
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSUseCompatibleCommands' , ' ' )]
334
332
param ( [Parameter ()]$Location )
335
- $newFileCatalog = Get-Command - ea silentlycontinue New-FileCatalog
333
+ $newFileCatalog = Get-Command - ErrorAction SilentlyContinue New-FileCatalog
336
334
if ($null -eq $newFileCatalog ) {
337
335
Write-Warning " New-FileCatalog not found, not creating catalog"
338
336
return
0 commit comments