Method: PSWindows::Exec#delete_env_var
- Defined in:
- lib/beaker/host/pswindows/exec.rb
#delete_env_var(key, val) ⇒ Object
Delete the provided key/val from the current ssh environment
137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/beaker/host/pswindows/exec.rb', line 137 def delete_env_var key, val key = key.to_s.upcase #get the current value of the key cur_val = subbed_val = get_env_var(key, true) subbed_val = (cur_val.split(';') - [val.gsub(/'|"/, '')]).join(';') if subbed_val != cur_val #remove the current key value self.clear_env_var(key) #set to the truncated value self.add_env_var(key, subbed_val) end end |