ScoopInstaller / Scoop

A command-line installer for Windows.

Home Page:https://scoop.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] In PowerShell, if `git` is an alias several operations break

giggio opened this issue · comments

Bug Report

Current Behavior

If you have git set to an alias scoop fails in some operations. I noticed so far: update and export.

Expected Behavior

These operations work.

Additional context/output

To reproduce:

Install hub: https://hub.github.com/

Set-Alias git hub

Try to run scoop export:

scoop export --config
# InvalidOperation: C:\Users\user\scoop\apps\scoop\current\lib\core.ps1:273
# Line |
#  273 |          return & $git @ArgumentList
#     |                   ~~~~
#     | The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.

Or update:

scoop update
# Scoop uses Git to update itself. Run 'scoop install git' and try again. 

Possible Solution

Temporary workaround: remove the alias:

Remove-Alias git

System details

Windows version: 11 (Microsoft Windows [Version 10.0.22631.3527])

OS architecture: 64bit

PowerShell version: 7.4.2 (Also fails in Windows PowerShell)

Additional software: N/A

Scoop Configuration

{
  "last_update": "2024-04-30T18:18:37.3207233-03:00",
  "scoop_repo": "https://github.com/lukesampson/scoop",
  "scoop_branch": "master"
}

Duplicate of #5196