How to correctly concatenate string in Powershell inline script in Azure DevOps?

后端 未结 3 1889
旧巷少年郎
旧巷少年郎 2021-01-16 18:08

I try to concatenate string to construct a path:

$SourceDirectoryPath = $(System.DefaultWorkingDirectory) + \"/solution/project/bin/Debug\"
$TargetFilePath =         


        
3条回答
  •  深忆病人
    2021-01-16 19:09

    You need to add quotes " " in the variables:

    $SourceDirectoryPath = "$(System.DefaultWorkingDirectory)" + "/solution/project/bin/Debug"
    $TargetFilePath = "$(System.DefaultWorkingDirectory)" + "/solution/project/bin/Debug/" + "$(Release.ReleaseName)" + "$(Release.EnvironmentName)"
    

提交回复
热议问题