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

后端 未结 3 1875
旧巷少年郎
旧巷少年郎 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 18:53

    This should work as well. $( ) outside of doublequotes would only be used to combine two or more statements. Most people don't even know about it.

    This is actually incorrect. I didn't know Azure Pipeline syntax. It just shows how confusing combining both Powershell and Azure Pipeline can be. This would work if $System were a Powershell object, not an Azure macro.

    $SourceDirectoryPath = $System.DefaultWorkingDirectory + '/solution/project/bin/Debug'
    

提交回复
热议问题