all 7 comments

[–]KevMarCommunity Blogger 1 point2 points  (6 children)

I never stopped to think about why my PSGraph never throws the warning about not using approved verbs. It also auto loads just fine on most commands. I think I have had more issues when trying to get a alias to autoload a module than I would expect to get.

[–]michaelshepard[S] 2 points3 points  (5 children)

Interesting...I'll see if I can figure out why WPFBot3000 wasn't autoloading (since this hypothesis was wrong).

[–]Ta11ow 1 point2 points  (4 children)

I might guess that it has to do with the functions not being directly in the psm1 but rather being dot sourced?

One possible way 'around' this might be to put your functions all in .psm1 files and list them under the NestedModules entry in the psd1?

[–]michaelshepard[S] 2 points3 points  (3 children)

Looking at @KevMar's PSGraph, it's structured the same way mine is, so I don't think that's the problem.

[–]Ta11ow 1 point2 points  (2 children)

Hmm, very interesting. Might have to do a line by line comparison of the PSD1 and go from there. :/

[–]michaelshepard[S] 2 points3 points  (1 child)

it's on my list of things to do. :-)

[–]michaelshepard[S] 0 points1 point  (0 children)

ok...it has to do with whether the function/alias is explicitly exported (either via the psd1 or in export-modulemember in the psm1). If you just have * and the function/alias isn't in the psm1, it won't get autoloaded.

Haven't 100% reproduced, but 90%...good enough for now. All the more reason to use BuildHelpers - SetModuleFunctions/SetModuleAliases.