Create windows path example using other system variable
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 143
- Forks
- 438
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 16
Description
This is for the windows_path resource. I am using Chef 12, but I read that it has moved to Chef by version 13.
Usecase: I wanted to add to the %PATH% something under local appdata on Windows. I tried referring to %LOCALAPPDATA% but found out that Windows system variables cannot include other system variables - https://superuser.com/questions/27826/why-cant-windows-handle-an-environment-variable-in-path
I ended up with reading %LOCALAPPDATA% and adding it to a string. Something like this:
my_path = "#{ENV['LOCALAPPDATA']}\\Apps\\OpenCover"
windows_path my_path do
action :add
notifies :request_reboot, 'reboot[Path updated]'
end
reboot 'Path updated' do
action :nothing
end
I think it would be a good example. I am not sure if the above approach can be done smarter though.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the windows_path resource documentation and review its existing examples. Add a Windows example that reads LOCALAPPDATA and uses it to build the path, then confirm the example explains the intended PATH update and reboot notification behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100