0
是否有包含爲msbuild調用的原始目標的變量? 基本上在Visual Studio中,我只需要在發佈時調用powershell腳本。帶原始目標的Msbuild變量
更新: 阿列克謝的回答後,我已經試過這樣:
<Target Name="DeployToAzure" AfterTargets="CopyPackageToDropLocation">
<PropertyGroup>
<PowerShellExe Condition=" '$(PowerShellExe)'=='' ">
%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe
</PowerShellExe>
</PropertyGroup>
<Exec Command="$(PowerShellExe) -ExecutionPolicy Unrestricted -noprofile -nologo " & { Write-Output 'Test' } "" />
</Target>
但執行卡住。我得到這個到輸出窗口(然後永遠掛起):
Task "Exec"
3> Task Parameter:Command=
3> %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe
3> -ExecutionPolicy Unrestricted -noprofile -nologo " & { Write-Output 'Test' } "
3>
3> %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe
3> -ExecutionPolicy Unrestricted -noprofile -nologo " & { Write-Output 'Test' } "
3> Windows PowerShell
3> Copyright (C) 2013 Microsoft Corporation. All rights reserved.
你從這個類似嘗試的東西問題: http://stackoverflow.com/questions/5824208/powershell-exit-code-calling-from-msbuild? –