首页 > 解决方案 > PowerShell 版本 4 或版本 5 程序集的引用路径

问题描述

我想在我的 C# 应用程序中托管 PowerShell version5 的程序集,我安装了 .NET Framework4.7,我只能System.management.automation.dll从以下路径中找到:

  1. C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll
  2. C:\windows\assembly\GAC_MSIL\System.Management.Automation

PowerShell V5 的程序集是哪一个?提前致谢!

标签: c#powershellpowershell-4.0

解决方案


如果您想引用主机上已安装的 Powershell 版本,您需要添加对System.Management.Automation.Powershell项目的引用。文章Windows Powershell 主机快速入门为您提供了坚韧不拔的详细信息。


推荐阅读