When I do "Get-Module -ListAvailable", powershell will print 169 modules. For example:
Directory: C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 15.0 SQLPS {Backup-SqlDatabase, Save-SqlMigrationReport, Invoke-PolicyEvaluation, Resto...
Directory: C:\Users\user\Documents\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 3.0.1 DotNetVersionLister Get-STDotNetVersion
Script 1.4.7 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource...}
Script 2.2.5 PowerShellGet {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability...}
Script 2.2.16 VSSetup {Get-VSSetupInstance, Select-VSSetupInstance}
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.3.1 Configuration {Import-Configuration, Export-Configuration, Get-StoragePath, Add-MetadataCo...
When I capture this in an array: "$m = Get-Module -ListAvailable" It seems like just a simple array, yet it also prints in these sections.
How is this done?
There doesn't even seem to be a "Directory" property on the PSModuleInfo objects.

