Open tgrader opened 1 year ago
@tgrader thanks for reaching out! I noticed that you are using Install-Package
(which comes from PackageManagement). Could you use Install-Module
(which comes from PowerShellGet V2).
Also, are the packages jQuery
and sampleDependency
published to the ADO feed?
Hello, Please find the results you've requested below.
PS C:\Users\trgrader> Find-Module -Repository PowershellAzureDevopsServices -Credential $credsAzureDevopsServices
Version Name Repository Description
------- ---- ---------- -----------
3.6.1 jQuery PowershellAzureDevo… jQuery is a new kind of JavaScript Libra…
1.0.0 SampleDependency PowershellAzureDevo… Sample forom PluralSight
1.0.0 trgraderrepro PowershellAzureDevo… Package description
PS C:\Users\trgrader> Install-Module -Name jquery -Repository PowershellAzureDevopsServices -Credential $credsAzureDevopsServices
Install-Package: Cannot find the path 'C:\Users\trgrader\AppData\Local\Temp\489951973\jQuery.3.6.1\jQuery.psd1' because it does not exist.
The problem is in Install-PackageUtility.ps1. This function calls a module-internal command named "Test-ValidModuleManifest" which triggers this error to be returned and does not honor the -Force parameter.
@travisgr PowerShellGet was originally really only meant to interact with PowerShell modules/scripts (hence why it's expecting to find a .psd1). We're working on a rewrite of PowerShellGet that better abstracts modules so that users have a better experience with generic .nupkgs and not just specifically PowerShell packages.
Could you try using the latest prerelease version and if there's anything you'd like to see improved or any new features you think would be nice to have we can address those changes there.
The latest version also fails to install this package. It's checking for the existence of a .ps1.
PS C:\Users\trgrader> Get-PSResource
Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
PowerShellGet 3.0.17 beta17 PSGallery PowerShell module with commands for discovering, installing, updating and …
Install-PSResource: Unable to successfully install package 'jQuery': 'Could not find file 'C:\Users\trgrader\AppData\Local\Temp\e587a46a-4d4a-410f-a4ba-509babc8b2c8\jquery\3.6.1\jQuery.ps1'.'
PS C:\Users\trgrader> Install-PSResource -Name Jquery -Repository PowershellAzureDevopsServices-psgetv3 -Credential $credsAzureDevopsServices -TrustRepository -Verbose
VERBOSE: All paths to search: 'C:\Users\trgrader\Documents\PowerShell\Modules'
VERBOSE: All paths to search: 'C:\Users\trgrader\Documents\PowerShell\Scripts'
VERBOSE: Performing the operation "Install-PSResource" on target "package to install: 'Jquery'".
VERBOSE: Parameters passed in >>> Name: 'Jquery'; Version: ''; Prerelease: 'False'; Repository: 'PowershellAzureDevopsServices-psgetv3'; AcceptLicense: 'False'; Quiet: 'False'; Reinstall: 'False'; TrustRepository: 'True'; NoClobber: 'False'; AsNupkg: 'False'; IncludeXml 'True'; SavePackage 'False'; TemporaryPath ''
VERBOSE: Attempting to search for packages in 'PowershellAzureDevopsServices-psgetv3'
VERBOSE: Untrusted repository accepted as trusted source.
VERBOSE: Searching in repository PowershellAzureDevopsServices-psgetv3
VERBOSE: credential successfully set for repository: PowershellAzureDevopsServices-psgetv3
VERBOSE: Begin installing package: 'jQuery'
VERBOSE: Successfully able to download package from source to: 'C:\Users\trgrader\AppData\Local\Temp\e84450de-4e24-4e4c-9c88-f6ccb236640a'
Install-PSResource: Unable to successfully install package 'jQuery': 'Could not find file 'C:\Users\trgrader\AppData\Local\Temp\e84450de-4e24-4e4c-9c88-f6ccb236640a\jquery\3.6.1\jQuery.ps1'.'
VERBOSE: Attempting to delete 'C:\Users\trgrader\AppData\Local\Temp\e84450de-4e24-4e4c-9c88-f6ccb236640a'
VERBOSE: Successfully deleted 'C:\Users\trgrader\AppData\Local\Temp\e84450de-4e24-4e4c-9c88-f6ccb236640a'
@travisgr thanks for trying this scenario out with PSGet V3. We're working to add better nupkg integration for packages like these which have neither .psd1 nor .ps1 file. These files are always present with PowerShell resources (off powershellgallery site) but we understand that packages from other repositories may not have this and we want to support those packages. The issue to track this work is here: https://github.com/PowerShell/PowerShellGet/issues/310
Prerequisites
Steps to reproduce
Expected behavior
Actual behavior
Error details
Environment data
Version
2.2.5
Visuals
No response