【发布时间】:2016-02-18 11:07:49
【问题描述】:
我有一个非常特殊的情况。我正在使用脚本来执行部署后操作。 我的 .pubml 中有以下 sn-p 代码
<Target Name="CopyServiceModules" AfterTargets="MSDeployPublish">
<Exec Command="powershell.exe -file "$(SolutionDir)PowerShellScripts\CopyModulesFiles.ps1" -workspacePath "$(ProjectDir)Modules" -deployPath "$(_MSDeployDirPath_FullPath)\Modules"" />
如果我从 powershell 运行脚本,它可以工作,当它由 Visual Studio 执行时,我收到此错误
file cannot be loaded because the execution of scripts is disabled on this system with pubxml file
我刚刚跑了
Set-ExecutionPolicy Unrestricted
在我的机器上,但它不起作用。 我还以管理员权限运行 Visual Studio 2015
有什么建议吗? 谢谢
【问题讨论】:
标签: visual-studio powershell visual-studio-2015 webdeploy