inspec/test/cookbooks/os_prepare/recipes/os_env.rb
Omar J. Irizarry 2495fd8196 extend os_env resource to select between Machine and User vars on Windows (#2945)
Signed-off-by: Omar J Irizarry <irizarry_omar_j@network.lilly.com>
2018-04-26 15:10:14 -04:00

15 lines
381 B
Ruby

# encoding: utf-8
# author: Omar Irizarry
#
# change a few Windows registry keys for testing purposes
if node['platform_family'] == 'windows'
powershell_script 'Write User TEMP' do
code <<-EOH
[System.Environment]::SetEnvironmentVariable('TEMP', 'C:\\TEMPUSER', [System.environmentVariableTarget]::User)
EOH
end
env 'TEMP' do
value 'C:\TEMPSYSTEM'
end
end