File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
AgentMode/.github/tsql/inner-loop Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,19 @@ if (!(Test-Path $sourceFile)) {
2020
2121# Print the source file path
2222Write-Host " Source file: $sourceFile "
23- # Run SqlPackage.exe /Action:Publish /SourceFile:$SourceFile /TargetConnectionString:$targetConnectionString /p:IncludeCompositeObjects=true
24- # Note $targetConnectionString can have $ in it
23+
24+ # Mask password in connection string for display
25+ $maskedConnectionString = $targetConnectionString -replace ' (?i)(Password|Pwd)=([^;]*)' , ' $1=*****'
26+
27+ # Print the publish command with masked password
28+ $maskedQuotedConnectionString = ' "' + $maskedConnectionString + ' "'
29+ $maskedPublishCommand = " $env: USERPROFILE \.dotnet\tools\SqlPackage.exe /Action:Publish /SourceFile:$sourceFile /TargetConnectionString:$maskedQuotedConnectionString /p:IncludeCompositeObjects=true"
30+ $maskedPublishCommand = $maskedPublishCommand -replace ' \$' , ' `$' # Escape $ in the connection string
31+ Write-Host " Running command: $maskedPublishCommand "
32+
33+ # Run the actual publish command (with real password)
2534$publishCommand = " $env: USERPROFILE \.dotnet\tools\SqlPackage.exe /Action:Publish /SourceFile:$sourceFile /TargetConnectionString:$quotedConnectionString /p:IncludeCompositeObjects=true"
2635$publishCommand = $publishCommand -replace ' \$' , ' `$' # Escape $ in the connection string
27- Write-Host " Running command: $publishCommand "
2836Invoke-Expression $publishCommand
2937if ($LASTEXITCODE -ne 0 ) {
3038 Write-Host " Failed to publish the DACPAC. Please check the output for errors."
You can’t perform that action at this time.
0 commit comments