Iron Contributor

Howdy Folks,


I have a simple query, being fond of using the Powershell in Windows Machines where I usually run the commands or install the modules and to do so we need to run the Windows PowerShell as an administrator!! But the same option is not available in MacOS.


Though I know how to use the Powershell for the current user in MacOS - (Steps to install the Powershell in MacOS)


Customize the Powershell in Terminal Application ( also done!


But running a Powershell as an admin is not happening in MacOS. Please help it out in this.


1 Reply

@Mitul Sinha 


You need to run pwsh under the login and environment of an Admin user (a user that is a member of the "admin" UNIX group in OSX).


To verify if a user account is member use the terminal command

   id username

and check if the Group "admin" is listed (usually it has the numerical ID 80)


Then switch to that user using the command

    sudo su - username

*This command will prompt you for your CURRENT user's password if you are allowed to use sudo


If you are not allowed to use sudo, use

    su - username

directly, this will prompt for the password of the user you want to switch to.


Note that "sudo su  - root" is the only way to switch to the root account (superuser admin) on OSX.


Once you switched to that user context, launch powershell



and install any module/package for -Scope AllUsers