【发布时间】:2018-12-16 15:45:34
【问题描述】:
如何获取当前正在运行的 Visual Studio 实例的实例? 我需要在 Visual Studio 之外访问 Visual Studio 对象模型 (DTE)。
我想从 powershell ise 运行一个 nuget 安装脚本 - 以便能够更好地了解脚本在做什么以及为什么它没有按照我的预期进行
所以我想输入 install.ps1 接受的所有参数
param(
[Parameter(Mandatory=$true)] [string] $installPath,
[Parameter(Mandatory=$true)] [string] $toolsPath,
[Parameter(Mandatory=$true)] $package,
[Parameter(Mandatory=$true)] $project
)
设置字符串参数很容易,gowever
项目和包是棘手的
我确实可以访问 nuget cmdlet。我关注了this 的帖子来实现这一目标。
所以我导入模块 PackageManagement.Cmdlets.dll
一切正常
现在当我尝试像
$project = Get-Project -name SmartCom.Registration.Logic
我收到此消息“必须打开一个项目才能运行此命令。”所以我想我首先需要通过 DTE 连接到 vs 并打开一个解决方案,然后加载一个项目才能使其工作?
我知道 PowerConsole 之类的东西可以自动与 vs 挂钩,但在这种情况下,我希望它在 vs 之外工作,以便我可以使用 powershell isa 对其进行调试
有什么想法吗?
【问题讨论】:
标签: visual-studio-2010 powershell nuget