-
Notifications
You must be signed in to change notification settings - Fork 11
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
Build.ps1 fails downloading PowerShell package #224
Comments
I noticed an additional warning:
Is it worth moving to |
Hi @nbarnwell, thanks for opening this issue - please can you share the output you get from |
HTH:
|
Thanks for that @nbarnwell. It's a bit of puzzle, we normally see these types of issues when the script is run in a Windows PowerShell terminal (where we've forgotten to set a What happens if you try to manually install the module?
If the above works, then I'd suggest adding the following to
|
That didn't work, and gave the same error. I'm convinced it's because of the tyre-fire that is PowerShellGet/CompatPowerShellGet/PSResourceGet at the moment. |
Further to my previous comment, I tried it on Windows PowerShell as opposed to PowerShell (i.e. the .NET Core-based one) and that install worked. However, the
|
Thanks for that @nbarnwell. Yes, the build does require PowerShell Core, so that's expected at least!
Could be :-) Although I thought the real 'fun' was going to start in the next version when they enable the compat layer and switch things over. I'll do an experiment to change the build script over to using
Also, in a fresh PowerShell session, please can you share the output from running the following immediately after
|
They've done that now, I think - see https://devblogs.microsoft.com/powershell/powershellget-in-powershell-7-4-updates/. They repurposed the name "PowerShellGet" to mean the compatibility layer between the old package management and the new PSResourceGet cmdlets. It used to be called "CompatPowerShellGet". I do a lot of PowerShell module stuff with an authenticated AzDO artifacts feed, so it's unsurprising I get a lot of results for the following. I expect the source of my problem is in here somewhere: 16:23:04 C:\Users\neil.barnwell PS> Get-Module -ListAvailable Microsoft.PowerShell.PSResourceGet
Directory: C:\program files\powershell\7\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Binary 1.0.4.1 Microsoft.PowerShell.PSResourceGet Core,Desk {Find-PSResource, Get-InstalledPSResour…
16:23:05 C:\Users\neil.barnwell PS> Get-Module -ListAvailable PowerShellGet
Directory: C:\Users\neil.barnwell\OneDrive - bybox.com\Documents\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Binary 3.0.20 beta20 PowerShellGet Desk {Find-PSResource, Get-PSResource, Get-P…
Binary 3.0.16 beta16 PowerShellGet Desk {Find-PSResource, Get-PSResource, Get-P…
Script 2.2.5.1 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-M…
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-M…
Directory: C:\program files\powershell\7\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-M…
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 1.0.0.1 PowerShellGet Desk {Install-Module, Find-Module, Save-Modu… also: PowerShell 7.4.2
Importing ByBox Modules...
16:25:03 C:\Users\neil.barnwell PS> cd c:\Code\Github\dotnet-adr
16:25:05 C:\Code\Github\dotnet-adr PS> .\build.ps1
WARNING: The cmdlet 'Install-Module' is deprecated, please use 'Install-PSResource'.
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"): a
Install-PSResource: C:\Code\Github\dotnet-adr\build.ps1:90
Line |
90 | Install-Module InvokeBuild -RequiredVersion $InvokeBuildModuleVer …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to successfully install package 'InvokeBuild': 'Object reference not set to an instance of an object.' to temporary installation path.
16:25:13 C:\Code\Github\dotnet-adr PS> get-module
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 0.0.3 CompatPowerShellGet {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability…}
Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest 7.0.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Script 0.0 PoshBookmarks {Clear-Bookmark, Get-Bookmark, Get-BookmarkKeys, Restore-BookmarkStatus…}
Binary 3.0.20 beta20 PowerShellGet {Find-PSResource, Get-PSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}
Script 2.3.5 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…} |
Thanks for all that @nbarnwell. I've opened a draft PR which switches the build script over to using My reading of that blog post, was that the compat layer wasn't getting switched-on by default until PS 7.5? It seems like your environment has already got those bits installed, so I'll do some testing this end to see if I can at least repro the issue after having installed those beta bits. I think the challenge will be how/if we can put guardrails in without bloating the script with more 'module installation' boilerplate. For sure a sign of 'fun times' ahead! |
build.ps1
Expected
Build to run
Actual
Build failed with following error:
Additional context
The text was updated successfully, but these errors were encountered: