-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow overriding environment variable scope #15
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.
I assume this is still WIP, since $Scope
isn't actually used yet.
Changes so far look great!
Yes, I did commit the follow up but looks like I forgot to push it. Will do so when I'm back at my pc. |
src/Agent.ps1
Outdated
[Parameter()] | ||
[ValidateSet("Machine", "Process", "User")] | ||
[string] | ||
$Scope = "Process" |
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.
Is this parameter being used?
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.
It is now! :) I forgot to commit the change
@dahlbyk @rkeithhill I've pushed up the missing change. This doesn't change the environment variable scope for the calls to |
Lines 3 to 6 in edcb790
|
@dahlbyk Good point, I'll remove the option for machine scope and leave just process/user. Not sure why my change to setenv isn't showing up in the PR, it shows in my local repo. I'll force push it up. |
6ca11cf
to
fa9df5f
Compare
fa9df5f
to
3c07600
Compare
@dahlbyk force push seems to have done it, the changes are showing now and I've removed machine scope from the options list. |
src/Utils.ps1
Outdated
$Scope = "Process" | ||
) | ||
|
||
$type = [System.EnvironmentVariableTarget]::Process |
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.
I'm reasonably certain you can just pass $Scope
directly to SetEnvironmentVariable()
and PS will automatically cast for you.
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.
@dahlbyk You're right. I've removed the conversion.
Allows changing the environment variable scope from Process to User/Machine. Also updated
Stop-SshAgent
andGet-SshAgent
to work with win32 openssh.