Skip to content
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

$env:Path not refreshed from prior actions? #57

Closed
bdruth opened this issue Jun 7, 2015 · 3 comments
Closed

$env:Path not refreshed from prior actions? #57

bdruth opened this issue Jun 7, 2015 · 3 comments

Comments

@bdruth
Copy link

bdruth commented Jun 7, 2015

I have a fairly simple manifest using chocolatey/chocolatey and puppetlabs/powershell - when I install a component that updates the Machine Path (i.e. [System.Environment]::GetEnvironmentVariable("Path","Machine")), and subsequently issue an Exec which depends on that, it fails because Powershell doesn't see the updated Path.

I've tried setting path => $::path, path => $([System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")) and various other permutations to try to force an up-to-date Path being used, to no avail.

Any magic to make this work? Thanks!

@ferventcoder
Copy link
Contributor

I don't believe path can run arbitrary PowerShell, which might be why it doesn't work as you might expect.

@bdruth
Copy link
Author

bdruth commented Jun 8, 2015

@bdruth bdruth closed this as completed Jun 8, 2015
@ferventcoder
Copy link
Contributor

One thing we might do is add code to Puppet that will refresh the path values. I created https://tickets.puppetlabs.com/browse/PUP-4708 to follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants