Skip to content

Install-PSResource installs script and not module #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
nabrond opened this issue Oct 4, 2021 · 1 comment
Closed
3 tasks done

Install-PSResource installs script and not module #501

nabrond opened this issue Oct 4, 2021 · 1 comment

Comments

@nabrond
Copy link

nabrond commented Oct 4, 2021

Prerequisites

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

Steps to reproduce

Attempting to install Pester v5.3.1 yields the following results.

PS> Install-PSResource -Name Pester -Verbose
VERBOSE: All paths to search: 'C:\Users\xxxx\OneDrive - xxxx\Documents\PowerShell\Modules'
VERBOSE: All paths to search: 'C:\Users\xxxx\OneDrive - xxxx\Documents\PowerShell\Scripts'
VERBOSE: Performing the operation "Install-PSResource" on target "package to install: 'Pester'".
VERBOSE: Parameters passed in >>> Name: 'Pester'; Version: ''; Prerelease: 'False'; Repository: ''; AcceptLicense: 'False'; Quiet: 'False'; Reinstall: 'False'; TrustRepository: 'False'; NoClobber: 'False';
VERBOSE: Attempting to search for packages in 'PSGallery'
VERBOSE: Untrusted repository accepted as trusted source.
VERBOSE: Null Type provided, so add PSGalleryScripts repository
VERBOSE: Searching in repository PSGallery
VERBOSE: 5.3.1.0
VERBOSE: Null Type provided, so add PSGalleryScripts repository
VERBOSE: Searching in repository PSGallery
VERBOSE: Begin installing package: 'Pester'
VERBOSE: Successfully able to download package from source to: 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c'
VERBOSE: Deleting 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c\pester\5.3.1\pester.5.3.1.nupkg.sha512'
VERBOSE: Deleting 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c\pester\5.3.1\pester.nuspec'
VERBOSE: Deleting 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c\pester\5.3.1\pester.5.3.1.nupkg'
VERBOSE: Installation source path is: 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c\pester\5.3.1'
VERBOSE: Installation destination path is: 'C:\Users\xxxx\OneDrive - xxxx\Documents\PowerShell\Scripts'
VERBOSE: Checking if path 'False' exists:
VERBOSE: Moving 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c\pester\5.3.1\Pester_InstalledScriptInfo.xml' to 'C:\Users\xxxx\OneDrive - xxxx\Documents\PowerShell\Scripts\InstalledScriptInfos\Pester_InstalledScriptInfo.xml'
VERBOSE: Checking if path 'False' exists:
VERBOSE: Moving 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c\pester\5.3.1\Pester.ps1' to 'C:\Users\xxxx\OneDrive - xxxx\Documents\PowerShell\Scripts\Pester.ps1'
VERBOSE: Successfully installed package 'Pester' to location 'C:\Users\xxxx\OneDrive - xxxx\Documents\PowerShell\Scripts'
VERBOSE: Attempting to delete 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9c'
VERBOSE: Successfully deleted 'C:\Users\xxxx\AppData\Local\Temp\93a42f70-85e3-4320-b551-d30a3099ae9

Expected behavior

PS> Install-PSResource -Name Pester
PS> Get-Module -Name Pester -List | ft Name,Version,ModuleBase -Auto

Name   Version ModuleBase
----   ------- ----------
Pester 5.3.1   C:\Users\xxxx\OneDrive - xxxx\Documents\PowerShell\Modules\Pester\5.3.1
Pester 3.4.0   C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0

Actual behavior

PS> Get-Module -Name Pester -List | ft Name,Version,ModuleBase -Auto

Name   Version ModuleBase
----   ------- ----------
Pester 3.4.0   C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0

Error details

No error reported.

Environment data

PS> Get-Module PowerShellGet; $PSVersionTable

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     3.0.11     beta       PowerShellGet                       {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Install-PSResource…}

PS> $PSVersionTable

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

Visuals

No response

@StevenBucher98
Copy link
Collaborator

Thanks @nabrond! We just closed a PR #504, this will be out in our next release and should be fixed then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants