1
我们有一个内部的NuGet包,它有一个readme.txt文件,我们希望在安装该包时显示该文件。要做到这一点,我们创建了看起来像包一个非常简单的init.ps1文件:NuGet init.ps1导致在调试台中进行调试
param($installPath, $toolsPath, $package, $project)
$path = [System.IO.Path]
$readmefile = $path::Combine($installPath, "content\Content\fonts\globalcons\readme.txt")
$DTE.ItemOperations.OpenFile($readmefile)
它做什么它应该并打开安装包时的readme.txt,但它也喷出以下在软件包管理器控制台中。
AutoHides : False
Caption : readme.txt
Collection : {Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase, Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase, Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase,
Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase...}
CommandBars :
ContextAttributes : System.__ComObject
DTE : EnvDTE.DTEClass
Document : System.__ComObject
HWnd : 0
Height : 1039
IsFloating : False
Kind : Document
Left : 1951
Linkable : False
LinkedWindowFrame : Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase
LinkedWindows :
Object : System.__ComObject
ObjectKind : {8E7B96A8-E33D-11D0-A6D5-00C04FB67F6A}
Project : System.__ComObject
ProjectItem : System.__ComObject
Selection : System.__ComObject
Top : 106
Type : vsWindowTypeDocument
Visible : True
Width : 1432
WindowState : vsWindowStateMaximize
HasBeenDeleted : False
Events : Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowEvents
VisibilityEvents : Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowVisibilityEvents
Rect : 1951,106,1432,1039
OutstandingEventCount : 0
我知道这是造成它,因为如果我注释掉$DTE.ItemOperations.OpenFile($readmefile)
线输出不包管理器控制台显示上述脚本。我无法弄清的是我做错了,导致输出每次都显示出来。
或者$ DTE.ItemOperations.OpenFile($ README文件)| Out-Null – 2015-01-27 07:16:59
我知道NuGet会在根文件夹中本地显示一个readme.txt文件。不幸的是,我们不想把它放在那里,我们想把它放在内容子文件夹中。 我会尝试虚空投射,看看会发生什么。 – 2015-01-27 16:22:19
FWIW我们把自述放在两个地方。根作为readme.txt,所以它会自动出现在*和*内容中作为 ReadMe.txt,因此它出现在项目中。 –
2015-01-27 18:36:10