Powershell: Install-Module not recognized

Created on 23 Mar 2018  路  8Comments  路  Source: PowerShell/PowerShell

Hi,

I'm using Archlinux and i've installed Powershell with AUR.
The PSVersion is 6.0.2

And there is no install-module cmdlet present.
Get-module works as expected but there is no cmdlet to install new module.

I give a try on a debian 9 and the cmdlet is present.

What can i do ?

Issue-Question Resolution-Answered

Most helpful comment

@eliohann Install-Module should work fine if you install powershell-bin. powershell does not build the OneGet module.

All 8 comments

Hi @eliohann, do you know what AUR installation method you used? Install-Module is part of the PowerShellGet module, and PowerShell needs to be built with Start-PSBuild -PSModuleRestore to include it. However, the AUR PowerShell repositories are maintained by the community, so I'm not sure what their configurations are.

@eliohann,

Just to make sure! Did you open pwsh with sudo? This is why repo the steps are important.

sudo pwsh

You can't use the Install-Module unless you open PowerShell as an Administrator.
:)

@MaximoTrinidad

sudo is not required to install modules and Install-Module should be present in non-sudo powershell sessions.

Install-Module -Scope CurrentUser -Name BetterTls

works from a non-sudo pwsh session on linux.

@eliohann Install-Module should work fine if you install powershell-bin. powershell does not build the OneGet module.

@markekraus,

So, if I use the -Scope CurrentUser, does it make the module available for any other users in the system?

To tell you the truth I never use the -Scope parameter. So, when I try to use install-module=, then I get the error that need to be run as Admin which I don't mind.

:)

@MaximoTrinidad CurrentUser would install it only for the current user. That works in like 99% of cases because the user installing the module is the user using it. System level modules should be installed through whatever configuration management is in place.

IMO, you should think really long an hard about installing modules for all users. It should be the exception to the rule. If your interested, PowerShell/PowerShellGet#236 has more on that.

@kylesferrazza thanks. solved from my side ;)

Closing. Thanks @kylesferrazza

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andschwa picture andschwa  路  3Comments

aragula12 picture aragula12  路  3Comments

ajensenwaud picture ajensenwaud  路  3Comments

manofspirit picture manofspirit  路  3Comments

Michal-Ziemba picture Michal-Ziemba  路  3Comments