0

I'm developing a powershell snapin derived from PSSnapIn.

If I manually copy my snapin.dll-help.xml file to the GAC get-help on my command works like expected.

So, is it possible to get InstallUtil to copy the xml file as well as the dll upon install?

Mikael Svenson
  • 39,181
  • 7
  • 73
  • 79

1 Answers1

3

If you can use PS V2, I would suggest creating a PowerShell V2 Module. This removes the need to use installutil. You can deploy with Xcopy if you want. You just need to create a module manifest. You can also include your help file in the directory of the module you create, and it will work. You still use the PSSnapin base class, but how you package it is different. This was one of the major improvements from V1 to V2. In PowerShell, run the command to get some info on modules.

PS> help about_module
Andy Schneider
  • 8,516
  • 6
  • 36
  • 52
  • 1
    I will check this out. I managed to get it working with installutil by adding a setup class, embedding the help file as a resource and writing it out in the OnAfterInstall method. – Mikael Svenson Jan 07 '11 at 15:01
  • I explored modules a bit. A module has to be installed either shared or personal and you have to add the module load path to the PSModulePath environment variable. To add the path and create the folder to place the files you would end up with an installer of some kind (could be a powershell script). So the question is, is it better to use an installer compared to a .bat file with installutil? I think the .bat approach might be preferable in many scenarios. – Mikael Svenson Jan 07 '11 at 19:06
  • Modules are intended to be installed to the user or machine location, just like application data. PowerShell will pick up help files from the location that the module is imported from. – JasonMArcher Jan 07 '11 at 19:53
  • Since modules can be loaded with a full path this is what I will go for :) Thanks! – Mikael Svenson Jan 10 '11 at 08:16