puppetlabs / puppetlabs-windows_env

Puppet module for managing Windows environment variables.
https://forge.puppet.com/puppet/windows_env
Apache License 2.0
14 stars 23 forks source link

Unable to Remove Entire Variable #73

Closed rick-bennett closed 1 year ago

rick-bennett commented 4 years ago

I'm testing out using version 4.0.1 of the module against Puppet 6.17.0 on a Windows 10 device (Version 1909 Build 18363.10.16), and am unable to completely remove an environment variable.

This successfully creates the variable:

    windows_env { 'VariableX':
      ensure    => present,
      mergemode => clobber,
      value     => 'some value here'
    }

However, this fails to remove the variable:

    windows_env { 'VariableX':
      ensure    => absent,
      mergemode => clobber
    }

I can see the 'VariableX' entry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, and have restarted at different points in my testing. All with the same result. I can remove the Value of the variable, but not the entire variable itself (even though the ReadMe states the above command should remove the variable completely).

Is this a bug?

Francommit commented 4 years ago

Facing the same problem - can't completely remove variables.

My specific use-case is I'm trying to remove the default windows user path variable:

    windows_env { 'bad_user_path':
      ensure    =>  absent,
      mergemode => clobber,
      variable  => 'PATH',
      user      => 'vagrant',
    }
bastelfreak commented 1 year ago

Hi, based on a discussion in https://groups.io/g/voxpupuli/message/449 we decided to archive this repository. I'm going to close all issues and PRs. If you're interested in maintaining the module, please respond to our mailinglist.