jborean93 / omi

Open Management Infrastructure
Other
111 stars 13 forks source link

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

Open mcx808 opened 1 year ago

mcx808 commented 1 year ago
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 commented 1 year ago

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?