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>