0
我有一個自定義的pubxml文件,其中包含一個執行PowerShell腳本的目標。這個powershell命令在我的網站部署之前成功運行。如何將pubxml文件中的PowerShell錯誤重定向到錯誤窗口
如果在powershell腳本中發生錯誤,輸出將被放入輸出窗口,但構建繼續,最終的消息將爲Publish:1成功。如果我的PowerShell腳本錯誤,我該如何停止發佈?
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PipelineDependsOn>
CopyConfigFiles;
$(PipelineDependsOn);
</PipelineDependsOn>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl></publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
<Target Name="CopyConfigFiles">
<Message Text="********************************** Deploying Config Files ***********************************" Importance="high"/>
<Exec Command="powershell.exe -ExecutionPolicy ByPass -File "$(SolutionDir)/Config/CopyConfigFiles.ps1" -ConfigSource "$(SolutionDir)/Config/""/>
</Target>