Help.xml and the PSModuleManifest
Posted: Thu May 28, 2015 10:23 pm
Hello Help-Writers,
PowerShell Help-Writer is the only fantastically cool product for the code that I'm currently working on! I started trying to write the .xml by hand and it was taking forever. I did learn a few xml tricks along the way, but this product certainly writes and validates xml the right way. Easily, so far.
So, I'm currently converting PowerShell script modules to PowerShell binary modules in C#, basically learning through examples in the PowerShell 3.0 SDK, where there is little to find about get-help and binary modules.
My old modules have the full comment-based help with many, many examples. Like 15 to 20.
I have already utilized the Sapien Help-Writer demo to it's full term, to successfully convert the comment based help files to xml files. Everything worked out very nicely in Visual Studio 2012 using C# as it usually does.
For Example: I have the following files in my User PSModule folder (I am using the well-formed naming of files and folders)
\Modules\MyBinaryPSModule\MyBinaryPSModule.psm1
\Modules\MyBinaryPSModule\MyBinaryPSModule.dll
\Modules\MyBinaryPSModule\MyBinaryPSModule.dll-Help.xml
This works well, but it's not quite finished without adding the manifest file named...
\WindowsPowerShell\Modules\MyBinaryPSModule\MyBinaryPSModule.psd1
What would be the best way to include the Help.xml in the module manifest?
Here is the basic content of the manifest that I have so far, but I can't get the Get-Help to work for the cmdlets written in the C# assembly that are the "Get-FirstBinaryCommand" etc.
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'MyBinaryPSModule.psm1'
# Modules that must be imported into the global environment prior to importing
# this module
RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
# Modules to import as nested modules of the module specified in
# ModuleToProcess
NestedModules = @('MyBinaryPSModule.dll')
# Cmdlets to export from this module
CmdletsToExport = @("Get-FirstBinaryCommand",
"Get-SecondBinaryCommand",
"Get-ThirdBinaryCommand")
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module
AliasesToExport = '*'
# List of all modules packaged with this module
ModuleList = @()
# List of all files packaged with this module
FileList = @()
# Private data to pass to the module specified in ModuleToProcess
PrivateData = ''
}
Actually, when I got this to work before, I had the 'MyBinaryPSModule.dll' as the ModuleToProcess, and I have continued to add a few non-binary cmdlets in the 'MyBinaryPSModule.psm1' which is now my ModuleToProcess.
Can you shed some light on this type of implementation using both script and binary cmdlets?
And how it add them to the module manifest?
Sincerly Yours,
roswald72
PowerShell Help-Writer is the only fantastically cool product for the code that I'm currently working on! I started trying to write the .xml by hand and it was taking forever. I did learn a few xml tricks along the way, but this product certainly writes and validates xml the right way. Easily, so far.
So, I'm currently converting PowerShell script modules to PowerShell binary modules in C#, basically learning through examples in the PowerShell 3.0 SDK, where there is little to find about get-help and binary modules.
My old modules have the full comment-based help with many, many examples. Like 15 to 20.
I have already utilized the Sapien Help-Writer demo to it's full term, to successfully convert the comment based help files to xml files. Everything worked out very nicely in Visual Studio 2012 using C# as it usually does.
For Example: I have the following files in my User PSModule folder (I am using the well-formed naming of files and folders)
\Modules\MyBinaryPSModule\MyBinaryPSModule.psm1
\Modules\MyBinaryPSModule\MyBinaryPSModule.dll
\Modules\MyBinaryPSModule\MyBinaryPSModule.dll-Help.xml
This works well, but it's not quite finished without adding the manifest file named...
\WindowsPowerShell\Modules\MyBinaryPSModule\MyBinaryPSModule.psd1
What would be the best way to include the Help.xml in the module manifest?
Here is the basic content of the manifest that I have so far, but I can't get the Get-Help to work for the cmdlets written in the C# assembly that are the "Get-FirstBinaryCommand" etc.
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'MyBinaryPSModule.psm1'
# Modules that must be imported into the global environment prior to importing
# this module
RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
# Modules to import as nested modules of the module specified in
# ModuleToProcess
NestedModules = @('MyBinaryPSModule.dll')
# Cmdlets to export from this module
CmdletsToExport = @("Get-FirstBinaryCommand",
"Get-SecondBinaryCommand",
"Get-ThirdBinaryCommand")
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module
AliasesToExport = '*'
# List of all modules packaged with this module
ModuleList = @()
# List of all files packaged with this module
FileList = @()
# Private data to pass to the module specified in ModuleToProcess
PrivateData = ''
}
Actually, when I got this to work before, I had the 'MyBinaryPSModule.dll' as the ModuleToProcess, and I have continued to add a few non-binary cmdlets in the 'MyBinaryPSModule.psm1' which is now my ModuleToProcess.
Can you shed some light on this type of implementation using both script and binary cmdlets?
And how it add them to the module manifest?
Sincerly Yours,
roswald72