dfinke / InstallModuleFromGitHub

Install PowerShell Modules from GitHub
Apache License 2.0
87 stars 31 forks source link

Doesn't appear to work any more? #27

Open Borgquite opened 2 years ago

Borgquite commented 2 years ago

On PowerShell 5.1, latest Windows 10.

Looks like the GitHub URLs are no longer valid?

Install-Module InstallModuleFromGitHub

Find-Module nameit | Install-ModuleFromGitHub

Invoke-RestMethod : {"message":"Not Found","documentation_url":"https://docs.github.com/rest"}
At C:\Program Files\WindowsPowerShell\Modules\InstallModuleFromGitHub\1.5.0\InstallModuleFromGitHub.psm1:48 char:17
+ ...             Invoke-RestMethod $url -OutFile $OutFile -Headers $header ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
rennerom commented 1 year ago

Without having a windows machine in front of me at the moment, the first thing that catches my eye is that you’re running PS 5.1.

I remember that the PSModulePath on windows changed from PS 5.1 to 7.x. Do you have to ability to test this with PS 7.1 or higher?

Borgquite commented 1 year ago

Hi,

I'm afraid not:

PowerShell 7.2.1
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\Users\user.name> Install-Module installmodulefromgithub
PS C:\Users\user.name> find-module nameit

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
2.3.5                NameIT                              PSGallery            PowerShell module to randomly generate n…

PS C:\Users\user.name> find-module nameit | Install-ModuleFromGitHub
Invoke-RestMethod: {"message":"Not Found","documentation_url":"https://docs.github.com/rest"}

Unblock-File: Cannot find path 'C:\Users\user.name\AppData\Local\Temp\NameIT.zip' because it does not exist.

Get-FileHash: Cannot find path 'C:\Users\user.name\AppData\Local\Temp\NameIT.zip' because it does not exist.

Expand-Archive: The path 'C:\Users\user.name\AppData\Local\Temp\NameIT.zip' either does not exist or is not a valid file system path.

Join-Path: Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'ChildPath'. Specified method is not
supported.

Copy-Item: Cannot find path 'C:\Users\user.name\AppData\Local\Temp\C:\Users\user.name\AppData\Local\Temp\_MEI144522
rennerom commented 1 year ago

Aha, this is an issue with the copy-path cmdlet. PR #25 was opened to address this.

Borgquite commented 1 year ago

Sure - although does that explain the first 'Invoke-RestMethod: {"message":"Not Found","documentation_url":"https://docs.github.com/rest"}' error at the top?