c# - PowerShell 版本 4 或版本 5 程序集的引用路径
问题描述
我想在我的 C# 应用程序中托管 PowerShell version5 的程序集,我安装了 .NET Framework4.7,我只能System.management.automation.dll
从以下路径中找到:
C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll
C:\windows\assembly\GAC_MSIL\System.Management.Automation
PowerShell V5 的程序集是哪一个?提前致谢!
解决方案
如果您想引用主机上已安装的 Powershell 版本,您需要添加对System.Management.Automation.Powershell
项目的引用。文章Windows Powershell 主机快速入门为您提供了坚韧不拔的详细信息。
推荐阅读
- mysql - 如何在 MySQL 中对空间索引进行分区或将其与 BTREE 索引结合使用?
- logging - 我的日志消息有问题,我无法解决
- rust - 如何使用 Cargo 用路径修补 crates-io?
- node.js - 来自 Postman 和 Node 的 HTTP 请求,但不是 React
- scala - Spark (Scala) 修改数据集列的内容
- python - OverflowError: (34, 'Numerical result out of range') 使用 PyTorch 学习率调度程序
- opencart - 在 Opencart V 3.0.3.0 中提交注册表时显示所有错误
- mysql - 计算日期之间
- android - 即使在取消订阅 IAP google 后也续订订阅
- php - 功能AFTER authentication and BEFORE view (laravel)