简体   繁体   English

PowerShell版本4或版本5程序集的引用路径

[英]reference path of PowerShell version 4 or version 5 assembly

I want to host a PowerShell version5's assembly in my C# application, I have .NET Framework4.7 installed, I only find the System.management.automation.dll from below paths: 我想在我的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

Which one is the PowerShell V5's assembly? 哪一款是PowerShell V5的组装? Thanks in advance! 提前致谢!

If you wanted to reference the installed version of Powershell on your host, you'd add a reference to System.Management.Automation.Powershell to your project. 如果要在主机上引用已安装的Powershell版本,则需要向项目添加对System.Management.Automation.Powershell的引用。 The article Windows Powershell Host Quickstart gives you the gritty details. 文章Windows Powershell主机快速入门为您提供了坚实的细节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM