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

Can no longer run Install-WSMan as sudo due to brew command refusing to to run as root #66

Open
mcx808 opened this issue Sep 11, 2023 · 1 comment

Comments

@mcx808
Copy link

mcx808 commented Sep 11, 2023

SUMMARY

It seems I can now no longer run sudo pwsh -Command "Install-WsMan -Verbose" since brew has deprecated being able to run as root/sudo and won't run the update commands this tries to run to gather info. Is there some other way to pass the info manually to the command to avoid calling brew?

OUTPUT
sudo pwsh -command 'Install-WsMan -Verbose'
VERBOSE: Attempting to get OpenSSL info with /opt/homebrew/bin/brew --prefix openssl
STDOUT:

STDERR: Error: Need to download https://formulae.brew.sh/api/formula.jws.json but cannot as root! Run `brew update` without `sudo` first then try again.


RC: 1
VERBOSE: Attempting to get OpenSSL info with /opt/homebrew/bin/brew --prefix openssl@3
STDOUT:

STDERR: Error: Need to download https://formulae.brew.sh/api/formula.jws.json but cannot as root! Run `brew update` without `sudo` first then try again.


RC: 1
VERBOSE: Attempting to get OpenSSL info with /opt/homebrew/bin/brew --prefix openssl@1.1
STDOUT:

STDERR: Error: Need to download https://formulae.brew.sh/api/formula.jws.json but cannot as root! Run `brew update` without `sudo` first then try again.


RC: 1
VERBOSE: Attempting to get OpenSSL info with /opt/homebrew/bin/brew --prefix openssl
STDOUT:

STDERR: Error: Need to download https://formulae.brew.sh/api/formula.jws.json but cannot as root! Run `brew update` without `sudo` first then try again.


RC: 1
VERBOSE: Attempting to get OpenSSL info with /opt/homebrew/bin/brew --prefix openssl@3
STDOUT:

STDERR: Error: Need to download https://formulae.brew.sh/api/formula.jws.json but cannot as root! Run `brew update` without `sudo` first then try again.


RC: 1
VERBOSE: Attempting to get OpenSSL info with /opt/homebrew/bin/brew --prefix openssl@1.1
STDOUT:

STDERR: Error: Need to download https://formulae.brew.sh/api/formula.jws.json but cannot as root! Run `brew update` without `sudo` first then try again.


RC: 1
VERBOSE: Failed to find OpenSSL with homebrew, falling back to port
VERBOSE: Failed to find port at 'port'
VERBOSE: Failed to find port at '/opt/local/bin/port'
VERBOSE: Host Info:

Install-WSMan: Failed to select the necessary library, the host isn't macOS, Linux based on GLIBC or musl, or OpenSSL isn't installed
MODULE VERSION
2.3.1
OS / ENVIRONMENT

pwsh 7.3.6 on macOS 13.5.2

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Darwin 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:17:35 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8112
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@mcx808
Copy link
Author

mcx808 commented Sep 11, 2023

UPDATE

It seems like this behaviour is actually caused by installing homebrew as a standard user. If I make my account an admin temporarily I'm able to install.
Still the question though: is there some way to pass details to Install-WsMan to prevent it calling homebrew?

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

No branches or pull requests

1 participant