使用PowerShell打开文件

是否有命令从Visual Studio的“程序包管理器控制台”(又称为PowerShell)中打开项目项(例如类文件)?当我在解决方案资源管理器中双击文件时,会发生同样的事情。

我尝试使用,Invoke-Item但是碰巧要打开Visual Studio的新实例。

戴维·布拉本特
$DTE.ExecuteCommand(“File.OpenFile”, "a path to your file")

您可以通过以下方式引用本地项目文件:

$path = [System.IO.Path]
$file = $path::Combine($path::GetDirectoryName($project.FileName), “your local path”)
$DTE.ExecuteCommand(“File.OpenFile”, $file)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章