Assert-Module:
Outputs unnecessary verbose statements due to -ListAvailable
is used each time
#66
Labels
enhancement
The issue is an enhancement request.
Details of the scenario you tried and the problem that is occurring
Every time when running
Assert-Module
and$VerbosePreference
is set to'Continue'
the command outputs a lot of verbose statements depending on what module is asserted.Steps to reproduce the problem
Outputs
Expected behavior
Only show these verbose messages when the module to assert is not in the session.
Current behavior
Always shows the verbose messages even if the module is already present in the session
Suggested solution to the issue
This is due to
-ListAvailable
is always used.DscResource.Common/source/Public/Assert-Module.ps1
Line 33 in 8000541
Suggest adding an evaluation
if (-not (Get-Module -Name $ModuleName))
before using-ListAvailable
. Using that will not output the verbose messages,.The operating system the target node is running
Windows Server 2016
Version and build of PowerShell the target node is running
5.1
Version of the module that was used
0.10.1
The text was updated successfully, but these errors were encountered: