设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 重新 试卷 文件
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

msbuild调用Windows 7下的powershell脚本获取签名错误

发布时间:2021-03-05 09:29 所属栏目:117 来源:网络整理
导读:我们有一个powerhell构建脚本,可以调用其他脚本,这些脚本在 Windows 7 64位下给我带来麻烦.它在XP下工作正常.我已经运行set-executionpolicy到RemoteSigned(并尝试使用Bypass和Unrestricted).我可以从错误信息中拉出命令行,并自行运行,并且运行正常. 构建错

我们有一个powerhell构建脚本,可以调用其他脚本,这些脚本在 Windows 7 64位下给我带来麻烦.它在XP下工作正常.我已经运行set-executionpolicy到RemoteSigned(并尝试使用Bypass和Unrestricted).我可以从错误信息中拉出命令行,并自行运行,并且运行正常.

构建错误在这里看起来很糟糕但是我还包括他们的完整性.

Project "C:\dev7\Source\DashPortal\DashboardGenerator\DashboardGenerator.csproj" (2) is building "C:\dev7\Source\DashPo
rtal\DashboardController\DashboardController.csproj" (15) on node 0 (default targets).
  File C:\Users\pmckinney.NA\Documents\WindowsPowerShell\profile.ps1 cannot be lo
  aded because the execution of scripts is disabled on this system. Please see "g
  et-help about_signing" for more details.
  At line:1 char:2
  + . <<<<  'C:\Users\pmckinney.NA\Documents\WindowsPowerShell\profile.ps1'
      + CategoryInfo          : NotSpecified: (:) [],PSSecurityException
      + FullyQualifiedErrorId : RuntimeException

  File C:\dev7\Source\DashPortal\DashboardController\..\..\..\Build\createReportI
  nstallScript.ps1 cannot be loaded because the execution of scripts is disabled
  on this system. Please see "get-help about_signing" for more details.
  At line:1 char:87
  + C:\dev7\Source\DashPortal\DashboardController\..\..\..\Build\createReportInst
  allScript <<<<  -t C:\dev7\Source\DashPortal\DashboardController\..\..\..\Sourc
  e\DashPortal\DashboardReports\ReportSetupScriptTemplate.sql -l C:\dev7\Source\D
  ashPortal\DashboardController\..\..\..\Source\DashPortal\DashboardReports\Repor
  tSetupReportList.xml -c C:\dev7\Source\DashPortal\DashboardController\..\..\..\
  Source\DashPortal\Config
      + CategoryInfo          : NotSpecified: (:) [],PSSecurityException
      + FullyQualifiedErrorId : RuntimeException

C:\dev7\Source\DashPortal\DashboardController\DashboardController.csproj(265,5): error MSB3073: The command "powershell
 C:\dev7\Source\DashPortal\DashboardController\..\..\..\Build\createReportInstallScript -t C:\dev7\Source\DashPortal\Da
shboardController\..\..\..\Source\DashPortal\DashboardReports\ReportSetupScriptTemplate.sql -l C:\dev7\Source\DashPorta
l\DashboardController\..\..\..\Source\DashPortal\DashboardReports\ReportSetupReportList.xml -c C:\dev7\Source\DashPorta
l\DashboardController\..\..\..\Source\DashPortal\Config" exited with code 1.
只是猜测:您在x64 PowerShell中运行了Set-ExecutionPolicy,构建运行x86 PowerShell?

也许在两个shell中尝试Get-ExcutionPolicy.

(编辑:ASP站长网)

    网友评论
    推荐文章
      热点阅读