Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Install-Module requires PowerShell to be run as root under Mac OS X #21

@SteveL-MSFT

Description

@SteveL-MSFT

From @ffeldhaus on September 16, 2016 18:19

Steps to reproduce

Install PowerShell 6 Alpha 10 and run powershell as a user who is not root nor member of the wheel group. Then run Install-Module -Name Posh-SSH which will fail with exception Could not find a part of the path.

Expected behavior

Either users who are not root nor member of the wheel group should be able to install Modules via Install-Module or if, for security reasons, installing modules should only be allowed to the root user or members of the wheel group, then Install-Module should fail with a hint that root privileges are required.

Actual behavior

PS /Users/ffeldhaus> Install-Module -Name Posh-SSH                                                                      

Untrusted repository
     PackageManagement\Install-Package : Could not find a part of the path                                              
'/usr/local/microsoft/powershell/6.0.0-alpha.10/Modules/Posh-SSH/1.7.6'.                                                
At /usr/local/microsoft/powershell/6.0.0-alpha.10/Modules/PowerShellGet/PSModule.psm1:1711 char:21                      
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters 
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                 
+ CategoryInfo          : NotSpecified: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Environment data

PS /Users/ffeldhaus>  $PSVersionTable                                                                                   

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      6.0.0-alpha                                                                             
PSEdition                      Core                                                                                    
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   3.0.0.0                                                                                 
GitCommitId                    v6.0.0-alpha.10                                                                         
CLRVersion                                                                                                             
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1

Copied from original issue: PowerShell/PowerShell#2286

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions