Skip to content

Commit

Permalink
To fix the issue jabbera#50 raised on May 28 2020
Browse files Browse the repository at this point in the history
To fix the issue  jabbera#50 raised on May 28 by @luke-barnett  

The issue appears on task version 8 as the script generated by the task looks like the following:
MyTopShelfService.exe" install  -username "MyUserName" -password:"***" 

While the above works perfectly fine in windows command prompt and in older task versions (probably due to a different version in PowerShell there), it fails if you run it with windows PowerShel.

To fix, the final script should be like: (look at the colon instead of space after username switch)

MyTopShelfService.exe" install  -username:"MyUserName" -password:"***"
  • Loading branch information
aminm-net committed Sep 10, 2020
1 parent 9d6fcee commit bcc3998
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Try {

Write-Host ("##vso[task.setvariable variable=E34A69771F47424D9217F3A4D6BCDC95;issecret=true;]$servicePassword") # Make sure the password doesn't show up in the log.

$additionalSharedArguments += " -username ""$serviceUsername"" -password"
$additionalSharedArguments += " -username:""$serviceUsername"" -password"
if (-Not [string]::IsNullOrWhiteSpace($servicePassword)) {
$additionalSharedArguments += ":""$servicePassword"""
}
Expand Down Expand Up @@ -107,4 +107,4 @@ Try {
}
finally {
Trace-VstsLeavingInvocation $MyInvocation
}
}

0 comments on commit bcc3998

Please sign in to comment.