-
Notifications
You must be signed in to change notification settings - Fork 138
Powershell 7 Get-InstalledModule not working #684
Comments
Thanks for letting us know of this issue @BohrenAn! Are you encountering this issue with |
@alerickson PS C:\Users\a.bohren> Get-PSResource -Name MicrosoftTeams ModuleType Version PreRelease Name ExportedCommands Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-It… |
@BohrenAn thanks for sharing this info! There's 2 aspects to it. Firstly, with searching for packages installed under "Program Files" included in the path, that denotes machine wide scope, so to search for it you would need to add Secondly, modules/scripts installed on WindowsPowerShell (i.e they have |
PowerShell 7 started as Administrator
It works with the MicrosoftTeams Module
With PowerShell 5
The Module is installed in two Directorys (has to be installed in each PowerShell Version separatly)
Seems to be that you can install some Modules and some not.
It's not consistent in any way. And i am not able to install several Modules in PowerShell 7. Find it very confusing... |
@BohrenAn we completely understand the frustration with this PowerShellGet V2 behavior. We are working on PowerShellGet V3 to be less confusing and handle such scenarios better. If you try finding the installed |
Hi @anamnavi Install-Module in PowerShell 5 is default to AllUsers? Here is the Output you asked for in PowerShell 7 PS C:> Get-Module Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…} PS C:> Get-InstalledModule -Name "MicrosoftTeams" 4.9.0 MicrosoftTeams PSGallery Microsoft Teams cmdlets module for Windows PowerShe… PS C:> Get-PSResource -Name "MicrosoftTeams" -Scope AllUsers MicrosoftTeams 4.9.0 PSGallery Microsoft Teams cmdlets module for Windows PowerShell and PowerShell Core.… PS C:> Get-PSResource -Name "MicrosoftTeams" -Scope CurrentUser |
@BohrenAn |
Prerequisites
Steps to reproduce
As you can see below, i am using PowerShell 7. Seems that Get-InstalledModule does not work there.
Get-Module does work.
See also: PowerShell/PowerShell#12271
PS C:> get-host
Name : ConsoleHost
Version : 7.2.6
InstanceId : fd07e65c-c9a5-4e9a-b473-661fc858c9a1
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-CH
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
PS C:> Get-InstalledModule MicrosoftTeams
Get-Package: No match was found for the specified search criteria and module names 'MicrosoftTeams'.
PS C:> Get-Module MicrosoftTeams -ListAvailable
ModuleType Version PreRelease Name PSEdition ExportedCommands
Script 4.8.0 MicrosoftTeams Core,Desk {Add-TeamChannelUser, Add-TeamUser, Connect-MicrosoftTeams, Disconnect-MicrosoftTeams…}
PS C:> Get-Module PowerShellGet -ListAvailable
ModuleType Version PreRelease Name PSEdition ExportedCommands
Binary 3.0.17 beta17 PowerShellGet Desk {Find-PSResource, Get-PSResource, Get-PSResourceRepository, Install-PSResource…}
ModuleType Version PreRelease Name PSEdition ExportedCommands
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
ModuleType Version PreRelease Name PSEdition ExportedCommands
Binary 3.0.17 beta17 PowerShellGet Desk {Find-PSResource, Get-PSResource, Get-PSResourceRepository, Install-PSResource…}
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
Script 1.0.0.1 PowerShellGet Desk {Install-Module, Find-Module, Save-Module, Update-Module…}
PS C:>
Expected behavior
Get-InstalledModule -Name <ModuleName> #Returns Information about installed Module
Actual behavior
Error details
No response
Environment data
Version
PowerShellGet 2.2.5
Visuals
The text was updated successfully, but these errors were encountered: