When using PowerShell modules on Hybrid Runbook Workers it is best to install modules via Install-Module
with -Scope AllUsers
. Same on Linux. That gives the following error though:
1 |
Install-Module: Administrator rights are required to install modules in '/usr/local/share/powershell/Modules'. Log on to the computer with an account that has Administrator rights, and then try again, or install '/home/rakhesh/.local/share/powershell/Modules' by adding "-Scope CurrentUser" to your command. You can also try running the Windows PowerShell session with elevated rights (Run as Administrator). |
So what you have to do is switch to root first, then launch PowerShell.
1 2 3 |
sudo su - pwsh Install-Module Az -Scope AllUsers |