When a host has no installled Module, the $installedModules is null and $installedModules.Contains() throws an exception
SUMMARY
When the host does not have an installed module (in any version of PowerShell), the community.windows.win_psmodule_info throws a:
Unhandled exception while executing module: You cannot call a method on a null-valued expression.
With the -vvv, the details of the exception are:
The full traceback is:
You cannot call a method on a null-valued expression.
At line:294 char:5
+ Add-ModuleRepositoryInfo -RepositoryName $module.Params.repositor ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Add-ModuleRepositoryInfo], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull,Add-ModuleRepositoryInfo
ScriptStackTrace:
at Add-ModuleRepositoryInfo<Process>, <No file>: line 261
at <ScriptBlock>, <No file>: line 293
System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
When a host has no installled Module, the $installedModules is null and $installedModules.Contains() throws an exception
SUMMARY
When the host does not have an installed module (in any version of PowerShell), the community.windows.win_psmodule_info throws a:
Unhandled exception while executing module: You cannot call a method on a null-valued expression.
With the -vvv, the details of the exception are:
ISSUE TYPE
COMPONENT NAME
module: community.windows.win_psmodule_info