-
-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Add-PoshGitToProfile -AllUsers
support
#504
Conversation
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.
LGTM
BTW we do have this code to determine if the process is elevated or not. Lines 115 to 124 in 65658bf
We could check if the process is not elevated and the user specified |
Done.
|
src/Utils.ps1
Outdated
@@ -104,9 +125,18 @@ function Add-PoshGitToProfile { | |||
$TestParams | |||
) | |||
|
|||
if ($AllUsers -and !(Test-Administrator)) { | |||
throw 'Installing posh-git for all users requires an elevated host.' |
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.
What do you think about rewording that as 'Adding posh-git to an AllUsers profile requires an elevated host.'
?
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.
Other than that, this PR looks good to me.
Toward including an option to install posh-git with Git for Windows (git-for-windows/git#1384), this adds an option to add to profile for all users.
Note that, as expected,
-AllUsers
from a non-elevated shell fails:or
Running PowerShell as Administrator allows the global install.