PowerShell / SHiPS

Simple Hierarchy in PowerShell - developing PowerShell provider got so much easier
MIT License
185 stars 31 forks source link

Suppress warnings about trying to import module without psd1 file #119

Closed matt9ucci closed 5 years ago

matt9ucci commented 5 years ago

If a provider module does not have *.psd1 file, warning messages are displayed by invoking New-PSDrive cmdlet:

PS> New-PSDrive -Name Austin -PSProvider SHiPS -Root 'FamilyTree#Austin'
WARNING: 'C:\Users\matt9ucci\SHiPS\samples\FamilyTree\FamilyTree.psd1' does not exist.
WARNING: Trying 'C:\Users\matt9ucci\SHiPS\samples\FamilyTree\FamilyTree.psm1'.

These warning messages are somewhat noisy, especially when running unit tests with Invoke-SHiPSTest function in setup.psm1.

*.psd1 files are not required for a module (see the official doc). It would be better to change the log level from warning to debug.

jianyunt commented 5 years ago

Thank you @matt9ucci for the fix!