vel
vel

Reputation: 1210

PowerShell 7 "Get-Package" command returns NOTHING as result. PowerShell 5 RETURNS list of packages on the same computer

I have many packages on my lap top. I have preinstalled PS 5 and installed PS 7. I install many software packages using the scripts in PS 7. If I run Get-Package command in PowerShell version 7 I am not getting anything as output.

PS C:\Windows\System32> Get-Package
PS C:\Windows\System32>

If I run the same command in PowerShell 5 on the same computer I am getting many results:

PS C:\windows\system32> Get-Package

Name                           Version          Source                           ProviderName
----                           -------          ------                           ------------

Git version 2.9.0              2.9.0                                             Programs
Microsoft SQL Server 2017 (...                                                   Programs
Microsoft SQL Server 2019 (...                                                   Programs
Office 16 Click-to-Run Exte... 16.0.11929.20606                                  msi
Office 16 Click-to-Run Loca... 16.0.11929.20606                                  msi
Office 16 Click-to-Run Lice... 16.0.11929.20606                                  msi

How is this possible??? Get-Command is the Windows command which should return result in any case. Please help, Thanks

Upvotes: 8

Views: 2765

Answers (1)

js2010
js2010

Reputation: 27606

It looks like newer Powershells don't support the Programs and Msi providers. Not good.

Get-PackageProvider  # from Powershell 5

Name     Version DynamicOptions
----     ------- --------------
msi      3.0.0.0 AdditionalArguments
Programs 3.0.0.0 IncludeWindowsInstaller, IncludeSystemComponent

Upvotes: 4

Related Questions