-
Notifications
You must be signed in to change notification settings - Fork 136
Merging the PowerShellGet changes from PowerShell\PowerShell repo. #4
Conversation
Includes the fix for PowerShell/PowerShell#2286 to provide proper error message when an user is trying to install a module/script as non-root user. #2
Hi @bmanikm, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
|
||
if($ev) | ||
{ | ||
$script:IsRunningAsElevated = $false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$script:IsRunningAsElevated = $false [](start = 12, length = 36)
what's the reason we need to set IsRunnignAsElevated to false before throwing? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be used for next install/update command to throw proper error/warning prior to downloading. This is used in Test-RunningAsElevated function.
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator | ||
$script:IsRunningAsElevated = $prp.IsInRole($adm) | ||
} | ||
elseif($script:IsCoreCLR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elseif($script:IsCoreCLR) [](start = 8, length = 25)
does this mean on CoreCLR we always require admin? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for Linux and Max, we assume that user has the admin rights, $script:IsRunningAsElevated will be updated on first copy error.
|
Includes the fix for PowerShell/PowerShell#2286 to provide proper error message when an user is trying to install a module/script as non-root user.
#2