ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
21.27k stars 1.41k forks source link

[Bug] Select-CurrentVersion : Cannot bind argument to parameter 'AppName' because it is an empty string. #5637

Closed brian6932 closed 1 year ago

brian6932 commented 1 year ago

Bug Report

Current Behavior

The same happens when used with -s, and/or using master instead of develop

❯ scoop install pwsh-beta@7.4.0.preview.3
WARN  Given version (7.4.0.preview.3) does not match manifest (7.4.0-preview.5)
WARN  Attempting to generate manifest for 'pwsh-beta' (7.4.0.preview.3)
Autoupdating pwsh-beta
DEBUG[1694246818.89665] [$updatedProperties] = [hash url] -> ~\scoop\apps\scoop\current\lib\autoupdate.ps1:447:5
DEBUG[1694246818.90466] $substitutions (hashtable) -> ~\scoop\apps\scoop\current\lib\autoupdate.ps1:185:5
DEBUG[1694246818.90466] $substitutions.$basename                      PowerShell-7.4.0.preview.3-win-x86.zip            
DEBUG[1694246818.90466] $substitutions.$preReleaseVersion             7.4.0.preview.3                                   
DEBUG[1694246818.90466] $substitutions.$baseurl                       https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3
DEBUG[1694246818.90466] $substitutions.$url                           https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3/PowerShel...
DEBUG[1694246818.90466] $substitutions.$dashVersion                   7-4-0-preview-3                                   
DEBUG[1694246818.90466] $substitutions.$underscoreVersion             7_4_0_preview_3                                   
DEBUG[1694246818.90466] $substitutions.$urlNoExt                      https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3/PowerShel...
DEBUG[1694246818.90466] $substitutions.$minorVersion                  4                                                 
DEBUG[1694246818.90466] $substitutions.$patchVersion                  0                                                 
DEBUG[1694246818.90466] $substitutions.$basenameNoExt                 PowerShell-7.4.0.preview.3-win-x86                
DEBUG[1694246818.90466] $substitutions.$dotVersion                    7.4.0.preview.3                                   
DEBUG[1694246818.90466] $substitutions.$matchTail                     .preview.3                                        
DEBUG[1694246818.90466] $substitutions.$buildVersion                  preview                                           
DEBUG[1694246818.90466] $substitutions.$majorVersion                  7                                                 
DEBUG[1694246818.90466] $substitutions.$cleanVersion                  740preview3                                       
DEBUG[1694246818.90466] $substitutions.$matchHead                     7.4.0                                             
DEBUG[1694246818.90466] $substitutions.$version                       7.4.0.preview.3                                   
DEBUG[1694246818.98372] $hashfile_url = https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3/hashes.sha256 -> ~\scoop\apps\scoop\current\lib\autoupdate.ps1:188:5
Searching hash for PowerShell-7.4.0.preview.3-win-x86.zip in https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3/hashes.sha256
The request was aborted: The connection was closed unexpectedly.
URL https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3/hashes.sha256 is not valid
Could not find hash in https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3/hashes.sha256
Downloading PowerShell-7.4.0.preview.3-win-x86.zip to compute hashes!
The remote server returned an error: (404) Not Found.
URL https://github.com/PowerShell/PowerShell/releases/download/v7.4.0.preview.3/PowerShell-7.4.0.preview.3-win-x86.zip is not valid
Could not install pwsh-beta@7.4.0.preview.3
Select-CurrentVersion : Cannot bind argument to parameter 'AppName' because it is an empty string.
At ~\scoop\apps\scoop\current\lib\core.ps1:294 char:54
+     return $null -ne (Select-CurrentVersion -AppName $app -Global:$gl ...
+                                                      ~~~~
    + CategoryInfo          : InvalidData: (:) [Select-CurrentVersion], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Select-CurrentVersion

You cannot call a method on a null-valued expression.
At ~\scoop\apps\scoop\current\lib\manifest.ps1:36 char:5
+     $app = $app.TrimStart('/')
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Expected Behavior

Used to just install fine

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 5.1.19041.3031

Scoop Configuration

{
  "alias": {},
  "debug": true,
  "cat_style": "full",
  "aria2-warning-enabled": false,
  "last_update": "2023-09-09T06:04:19.8867184-04:00",
  "aria2-options": "--conf-path=~\\.aria2\\aria2.conf",
  "aria2-max-connection-per-server": "16",
  "aria2-max-concurrent-downloads": "16",
  "aria2-min-split-size": "1M",
  "aria2-split": "64",
  "scoop_branch": "develop",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop"
}
rashil2000 commented 1 year ago

You are using wrong version string - scoop install pwsh-beta@7.4.0.preview.3.

The correct string is scoop install pwsh-beta@7.4.0-preview.3

brian6932 commented 1 year ago

oh, my bad