dsccommunity / DscResource.DocGenerator

Module for generation of DSC resource documentation
MIT License
9 stars 10 forks source link

Generate_Conceptual_Help: Fails if module script file contain advanced types #121

Open johlju opened 2 years ago

johlju commented 2 years ago

Details of the scenario you tried and the problem that is occurring

If for example a class-based resource contain a advanced type the task fails to process the conceptual help (this will probably true for Wiki generation as well).

Steps to reproduce the problem

Add the following to the built module script file (.psm1):

class SqlDatabasePermission
{
    hidden [Microsoft.SqlServer.Management.Smo.Server] $sqlServerObject = $null

    # Other code removed for readability
}

Expected behavior

Should be able to handle advanced types that is not loaded.

Current behavior

Throws the error:

ERROR: At C:\source\SqlServerDsc\output\SqlServerDsc\16.0.0\SqlServerDsc.psm1:745 char:13
+     hidden [Microsoft.SqlServer.Management.Smo.Server] $sqlServerObje …
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unable to find type [Microsoft.SqlServer.Management.Smo.Server].
At C:\source\SqlServerDsc\output\RequiredModules\DscResource.DocGenerator\0.11.0\DscResource.DocGenerator.psm1:3085 char:17
+                 throw $parseErrors
+                 ~~~~~~~~~~~~~~~~~~

Suggested solution to the issue

Personally I prefer option 2.

The operating system the target node is running

n/a

Version and build of PowerShell the target node is running

7.2

Version of the module that was used

0.11.0

gaelcolas commented 2 years ago

I prefer option 2 as well.