Skip to content
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

[Bug] Installing Scoop fails: "The term 'Select-CurrentVersion' is not recognized" #4783

Closed
strager opened this issue Mar 8, 2022 · 17 comments · Fixed by #4785
Closed

[Bug] Installing Scoop fails: "The term 'Select-CurrentVersion' is not recognized" #4783

strager opened this issue Mar 8, 2022 · 17 comments · Fixed by #4785
Labels

Comments

@strager
Copy link

strager commented Mar 8, 2022

Bug Report

Current Behavior

I am trying to install Scoop. Running in the installer script (https://get.scoop.sh) fails:

PS> & .\install-scoop.ps1

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\Users\strager\Downloads\install-scoop.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R
Initializing...
Select-CurrentVersion : The term 'Select-CurrentVersion' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:222 char:23
+     return $null -ne (Select-CurrentVersion -AppName $app -Global:$gl ...
+                       ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Select-CurrentVersion:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

Expected Behavior

I expect Scoop to install without any errors reported.

Additional context/output

PS> echo $psversiontable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1320
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1320
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Possible Solution

System details

Windows version: 10

OS architecture: 64bit

PowerShell version:

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  1320

Additional software:

Scoop Configuration

Not applicable.

@rashil2000
Copy link
Member

/cc @niheaven

@niheaven
Copy link
Member

niheaven commented Mar 8, 2022

iwr -useb https://raw.githubusercontent.com/ScoopInstaller/Install/master/install.ps1 | iex

Could you please try this first and see if works?

@deadprogram
Copy link

We are now seeing this same issue on our Github actions-based CI: https://github.com/tinygo-org/tinygo/runs/5460413855?check_suite_focus=true#step:3:16

@niheaven
Copy link
Member

niheaven commented Mar 8, 2022

Sorry, will be fixed today, and please use a pre-release script that I mentioned above.

@deadprogram
Copy link

Thanks for the quick reply @niheaven it is appreciated!

@leaderiop
Copy link

iwr -useb https://raw.githubusercontent.com/ScoopInstaller/Install/master/install.ps1 | iex

Could you please try this first and see if works?

it works for me

@jianhua1996
Copy link

i tried this way, but it's not work
got an error message
Running the installer as administrator is disabled by default, use -RunAsAdmin parameter if you know what you are doing.

@dsoldo
Copy link

dsoldo commented Mar 8, 2022

i tried this way, but it's not work got an error message Running the installer as administrator is disabled by default, use -RunAsAdmin parameter if you know what you are doing.

For me the problem was in Company Group Policy + PORT was locked

i hope this helps

@chawyehsu
Copy link
Member

@jianhua1996

Running the installer as administrator is disabled by default, use -RunAsAdmin parameter if you know what you are doing.

Please check ScoopInstaller/Install#advanced-installation for documentation about this issue.

@jianhua1996
Copy link

@jianhua1996

Running the installer as administrator is disabled by default, use -RunAsAdmin parameter if you know what you are doing.

Please check ScoopInstaller/Install#advanced-installation for documentation about this issue.

I reinstalled the app when this bug was fixed, everything is ok.
Thank you for your reply

cprieto added a commit to prisma/prisma-engines that referenced this issue Mar 10, 2022
Apparently a bug was introduced with the scoop installer ScoopInstaller/Scoop#4783 They suggest to install it directly
@janpio
Copy link
Contributor

janpio commented Mar 11, 2022

Please check ScoopInstaller/Install#advanced-installation for documentation about this issue.

Is this new? This looks like a breaking change on our side as the script was working fine in GH Actions context before, but now needs to be done differently without any change.

@rashil2000
Copy link
Member

It's an updated and standalone installer written by @chawyehsu.

It looks like it's breaking a lot of automated actions which run as admin. @chawyehsu can we introduce a workaround for this to have parity with the old installer?

Weakky pushed a commit to prisma/prisma-engines that referenced this issue Mar 11, 2022
Apparently a bug was introduced with the scoop installer ScoopInstaller/Scoop#4783 They suggest to install it directly
@AndrewSav
Copy link

@rashil2000 this issue is closed, do we need a new one to track the concern in your message?

@rashil2000
Copy link
Member

The Readme for installation has been updated.

@Egor18032019
Copy link

Попробуй
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"

@square-story
Copy link

Попробуй iex "& {$(irm get.scoop.sh)} -RunAsAdmin"

thanks 👍
it's work for me

@muhammad-fiaz
Copy link

muhammad-fiaz commented Jan 6, 2025

Попробуй iex "& {$(irm get.scoop.sh)} -RunAsAdmin"

yes this works :)

Ensure the command is executed in a PowerShell with administrative privileges:

iex "& {$(irm get.scoop.sh)} -RunAsAdmin"

also this has been reported with the same solution on Stackoverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.