Skip to content

Install-PSResource thinks Pester is a script not a module #383

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
hbuckle opened this issue Jun 22, 2021 · 4 comments
Closed

Install-PSResource thinks Pester is a script not a module #383

hbuckle opened this issue Jun 22, 2021 · 4 comments

Comments

@hbuckle
Copy link

hbuckle commented Jun 22, 2021

Installing the latest version of Pester (5.2.2) does not install the module, it just installs a Pester.ps1 script into Documents\PowerShell\Scripts

Install-PSResource -Name Pester -Version 5.2.2 -Scope CurrentUser -Verbose -Debug -Repository PSGallery
DEBUG: Parameters passed in >>> Name: 'Pester'; Version: '5.2.2'; Prerelease: 'False'; Repository: 'PSGallery'; Scope: 'CurrentUser'; AcceptLicense: 'False'; Quiet: 'False'; Reinstall: 'False'; TrustRepository: 'False'; NoClobber: 'False';
DEBUG: Entering InstallHelper::ProcessInstallParams
DEBUG: Console is elevated: 'False'
DEBUG: Console is Windows PowerShell: 'False'
DEBUG: Current user scope installation path: 'C:\Users\henry.buckle\Documents\PowerShell'
DEBUG: All users scope installation path: 'C:\Program Files\PowerShell'
VERBOSE: Scope is: CurrentUser
DEBUG: Checking to see if paths exist
DEBUG: Path: 'C:\Users\henry.buckle\Documents\PowerShell\Modules'  >>> exists? 'True'
DEBUG: Path: 'C:\Users\henry.buckle\Documents\PowerShell\Scripts'  >>> exists? 'True'
DEBUG: Path: 'C:\Users\henry.buckle\Documents\PowerShell\Scripts\InstalledScriptInfos'  >>> exists? 'True'
DEBUG: Attempting to search for packages in 'PSGallery'
DEBUG: Checking if untrusted repository should be used

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its Trusted value by running the Set-PSResourceRepository cmdlet. Are you sure you want to install the PSresource from 'PSGallery' ?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y
DEBUG: Untrusted repository accepted as trusted source.
DEBUG: Parsed version is: '[5.2.2, 5.2.2]'
VERBOSE: Begin installing package: 'Pester'
DEBUG: Successfully able to download package from source to: 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8'
DEBUG: Deleting 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8\pester\5.2.2\pester.5.2.2.nupkg.sha512'
DEBUG: Deleting 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8\pester\5.2.2\pester.nuspec'
DEBUG: Deleting 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8\pester\5.2.2\pester.5.2.2.nupkg'
DEBUG: Installation path is: 'C:\Users\henry.buckle\Documents\PowerShell\Scripts'
VERBOSE: Full installation path is: 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8\pester\5.2.2'
DEBUG: Checking if path 'False' exists:
DEBUG: Checking if path 'False' exists:
DEBUG: Moving 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8\pester\5.2.2\Pester_InstalledScriptInfo.xml' to 'C:\Users\henry.buckle\Documents\PowerShell\Scripts\InstalledScriptInfos\Pester_InstalledScriptInfo.xml'
DEBUG: Moving 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8\pester\5.2.2\Pester.ps1' to 'C:\Users\henry.buckle\Documents\PowerShell\Scripts\Pester.ps1'
VERBOSE: Successfully installed package Pester
DEBUG: Attempting to delete 'C:\Users\henry.buckle\AppData\Local\Temp\e34066dc-c3a0-4da8-bad8-615d7ff351b8'

Previous version 5.1.1 installed correctly as a module

@anamnavi
Copy link
Member

thanks @hbuckle, we are testing out refactored version of Install-PSResource and seeing if this is still an issue and aim to resolve this.

@hbuckle
Copy link
Author

hbuckle commented Aug 12, 2021

Still an issue on 3.0.11

Install-PSResource -Name Pester -Repository PSGallery -Scope CurrentUser -Verbose -TrustRepository
VERBOSE: All paths to search: 'C:\Users\henry.buckle\Documents\PowerShell\Modules'
VERBOSE: All paths to search: 'C:\Users\henry.buckle\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: 'PSGallery'; AcceptLicense: 'False'; Quiet: 'False'; Reinstall: 'False'; TrustRepository: 'True'; 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.2.2.0
VERBOSE: Null Type provided, so add PSGalleryScripts repository
VERBOSE: Searching in repository PSGallery
VERBOSE: Searching through package path: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester'
VERBOSE: Searching through package path: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester'
VERBOSE: Searching through package version path: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester\5.2.2'
VERBOSE: Directory parsed as NuGet version: '5.2.2'
VERBOSE: Reading package metadata from: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester\5.2.2\PSGetModuleInfo.xml'
VERBOSE: Searching through package path: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester'
VERBOSE: Searching through package path: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester'
VERBOSE: Searching through package version path: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester\5.2.2'
VERBOSE: Directory parsed as NuGet version: '5.2.2'
VERBOSE: Reading package metadata from: 'C:\Users\henry.buckle\Documents\PowerShell\Modules\Pester\5.2.2\PSGetModuleInfo.xml'
WARNING: Resource 'Pester' with version '5.2.2' is already installed.  If you would like to reinstall, please run the cmdlet again with the -Reinstall parameter
VERBOSE: Begin installing package: 'Pester'
VERBOSE: Successfully able to download package from source to: 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67'
VERBOSE: Deleting 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67\pester\5.2.2\pester.5.2.2.nupkg.sha512'
VERBOSE: Deleting 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67\pester\5.2.2\pester.nuspec'
VERBOSE: Deleting 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67\pester\5.2.2\pester.5.2.2.nupkg'
VERBOSE: Installation source path is: 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67\pester\5.2.2'
VERBOSE: Installation destination path is: 'C:\Users\henry.buckle\Documents\PowerShell\Scripts'
VERBOSE: Checking if path 'True' exists:
VERBOSE: Deleting script metadata XML
VERBOSE: Moving 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67\pester\5.2.2\Pester_InstalledScriptInfo.xml' to 'C:\Users\henry.buckle\Documents\PowerShell\Scripts\InstalledScriptInfos\Pester_InstalledScriptInfo.xml'
VERBOSE: Checking if path 'True' exists:
VERBOSE: Deleting script file
VERBOSE: Moving 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67\pester\5.2.2\Pester.ps1' to 'C:\Users\henry.buckle\Documents\PowerShell\Scripts\Pester.ps1'
VERBOSE: Successfully installed package 'Pester' to location 'C:\Users\henry.buckle\Documents\PowerShell\Scripts'
VERBOSE: Attempting to delete 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67'
VERBOSE: Successfully deleted 'C:\Users\henry.buckle\AppData\Local\Temp\b4602d41-b73d-41c2-a21d-421943f50b67'

@anamnavi
Copy link
Member

thank @hbuckle, we agree this should not be happening and we're going to address this by the next preview

@alerickson
Copy link
Member

Resolved with PR #477

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

3 participants