PowerShell / PowerShellGet

This module provide functions used with PowerShellGet v3 to provide compatibility with scripts expecting PowerShellGet v2

Home Page:https://www.powershellgallery.com/packages/PowerShellGet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PowerShellGet 2.9.0-Preview Get-InstalledModule throws Error

BohrenAn opened this issue · comments

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

I've installed the PowerShellGet 2.9.0-Preview Module Side by Side

Install-Module PowerShellGet -AllowPrerelease -Force

#PowerShell 5.1
Get-Module
Get-InstalledModule MicrosoftTeams
Get-Module MicrosoftTeams -ListAvailable
PowerShellGet_2 9 0_Preview_04

#PowerShell 7.3.7
Import-Module PowerShellGet -RequiredVersion 2.9.0
Get-Module
Get-InstalledModule MicrosoftTeams
Get-Module MicrosoftTeams -ListAvailable
PowerShellGet_2 9 0_Preview_05

Expected behavior

Get-InstalledModule <ModuleName> shows a result

Actual behavior

Get-InstalledModule <ModuleName> throws an Error

Error details

$Error.Clear()
Get-InstalledModule MicrosoftTeams
$Error

Exception calling "GetSteppablePipeline" with "0" argument(s): "The expression after '&' in a pipeline element produced an object that was not
valid. It must result in a command name, a script block, or a CommandInfo object."
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.9.0\PowerShellGet.psm1:772 char:13
+             $steppablePipeline = $scriptCmd.GetSteppablePipeline()
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : RuntimeException

Environment data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.1778
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.1778
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

and 

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.7
PSEdition                      Core
GitCommitId                    7.3.7
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

5.1 and 7.3.7

Visuals

No response

This also occurs consistently with 3.0.22-beta22 in both desktop and core.

Name                           Value
----                           -----
PSVersion                      5.1.20348.1850
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.1850
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Name                           Value
----                           -----
PSVersion                      7.3.7
PSEdition                      Core
GitCommitId                    7.3.7
OS                             Microsoft Windows 10.0.20348
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

I just installed PowershellGet 3.0.23 and can confirm this is still an issue

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     3.0.23     beta23     PowershellGet                       {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability…}

Powershell Version:

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.23541
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PowershellGet v3 freshly installed

Same here. How to downgrade to 2.2.5?
Nevermind deleting the folder "C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\3.0.23" did the trick.