SAPIEN Forums

Does not recognize ActiveDirectory module objects

Does not recognize ActiveDirectory module objects

Posted: Fri Nov 25, 2016 2:31 pm

by mpalmer

I'm currently using a trial version of PowerShell HelpWriter version 1.1.20 x64.

I'm trying to create a new help file from an existing module and when I attempt to Export it I get an error that says unable to find type [Microsoft.ActiveDirectory.Management.ADUser]. When I click OK on that message I get another popup that is just blank (exactly the same as a previous post on here). When I click OK on the blank popup it goes away and then it just sits at the Select Module window and never completes.

pshw_popup1.png (20.98 KiB) Viewed 7660 times

pshw_popup2.png (19.58 KiB) Viewed 7660 times

Re: Does not recognize ActiveDirectory module objects

Posted: Mon Nov 28, 2016 9:50 am

by davidc

Thank you for reporting the issue. We are investigating and we will respond once we have an update.

Re: Does not recognize ActiveDirectory module objects

Posted: Mon Nov 28, 2016 12:53 pm

by juneblender

I've tried to repro this issue with ActiveDirectory 1.0.0.0 and HelpWriter 1.1.20 on Server 2016 and Windows 10 Pro with RSAT. No luck. It generates the help file for all exported commands.

Not sure which difference is causing my setup to respond differently. I can share the dll-help.xml file if that would help you.

Re: Does not recognize ActiveDirectory module objects

Posted: Mon Nov 28, 2016 1:37 pm

by mpalmer

Sorry, I'm not sure what the dll-help.xml is or how that would help me...

I could also supply you with the module to test if that would be helpful.

Thanks

Re: Does not recognize ActiveDirectory module objects

Posted: Mon Nov 28, 2016 2:07 pm

by juneblender

Oh, sorry! A dll-help.xml file is a PowerShell help file. I thought you were trying to create a help file for the official ActiveDirectory module. Now I realize that this is your own module.

Before I look at your module, please run this command and let me know if it runs without error:
(Get-Command -Module <ModuleName>).ParameterSets.Parameters
where <ModuleName> is the name of your module.

We'll figure this out.

Re: Does not recognize ActiveDirectory module objects

Posted: Mon Nov 28, 2016 2:13 pm

by mpalmer

Oh. My apologies, looking at my original post it definitely wasn't clear I was creating it for my own module.

Re: Does not recognize ActiveDirectory module objects

I've uploaded the file. It had an error that said the file had been uploaded successfully but it wasn't able to notify support.

Re: Does not recognize ActiveDirectory module objects

Posted: Tue Nov 29, 2016 11:25 am

by juneblender

I have it. It uploaded just fine despite the error, which I reported to our web master. Give me a few minutes to check.

Re: Does not recognize ActiveDirectory module objects

Posted: Tue Nov 29, 2016 12:08 pm

by juneblender

Thanks for uploading the module. It really helps to be looking at the same code. The zip contained only a .psm1; no module manifest (.psd1). If I'm missing content, please let me know. There are a few things that I can't test, because I don't have the Exchange and Skype modules.

I suspect that the problem is that the required modules are not being loaded. To load dependent modules, use the RequiredModules key in the module manifest. To add a module manifest, use the New-ModuleManifest cmdlet or, in PowerShell Studio, use New/New module project, which creates a module manifest for you, or New/Script and then use the ModuleManifest snippet.

When you import this module (without a .psd1 file), do the functions works as expected? In particular, does the function with the mandatory parameter of type [Microsoft.ActiveDirectory.Management.ADUser] work? Are you running PowerShell HelpWriter on the same machine with the same user account?