Forge Home

showhidden_win

This module shows or hides file extensions or hidden folders in Windows.

6,148 downloads

74 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.2 (latest)
  • 0.1.0
released Jul 17th 2024
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'tvories-showhidden_win', '0.1.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add tvories-showhidden_win
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install tvories-showhidden_win --version 0.1.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

tvories/showhidden_win — version 0.1.2 Jul 17th 2024

showhidden_win

Manage how hidden folders and file type extensions are displayed in Windows machines. This module leverages Microsoft Active Setup to set the hidden folder or hidden file extension preferences.

Briefly, Active Setup is a registry key that runs "something" at logon one time for every user that logs into the machine. It's difficult for puppet to update HKCU registry keys, so to get past that you can have Active Setup run a command which updates the HKCU key for every user that logs in.

This module runs reg add to update the HKCU registry entry for hiding or showing files and folders or file extensions. By default, this module sets Windows to show hidden files and folders and to show file extensions. You can adjust this to your preference.

Another thing to note about using Active Setup to manage HKCU is that it will only run once per version number. Version numbers are a string value of '1,0,0' or similar. If you decide to change your preferences and want to only show file extensions but not hidden files and folders, you will need to increment the version number.

For example, say you initially set your preferences to:

class { 'showhidden_win':
    show_file_ext_version       => '1,0,0',
    show_hidden_folders_version => '1,0,0',
    show_file_ext               => true,
    show_hidden_folders         => true,
  }

and now you want to change those preferences to not show hidden folders. You would then set your preferences to:

class { 'showhidden_win':
  show_file_ext_version       => '1,0,0',
  show_hidden_folders_version => '1,0,1',  # <--- MUST INCREMENT THIS NUMBER
  show_file_ext               => true,
  show_hidden_folders         => false,
}

By incrementing the version number, Active Setup will run again on a users next login to update the preferences you have set. If you do not update the version number, the settings will not re-run.

Parameters

  • show_file_ext - [Optional] Boolean. Defaults to true. true if you want to show file extensions. false if you want to hide.
  • show_hidden_folders - [Optional] Boolean. Defaults to true. true if you want to show hidden files and folders. false if you want to hide.
  • show_file_ext_version - [Required] String value version number. Must be comma values, not periods. IE: 1,0,0, NOT 1.0.0 <-- invalid.
  • show_hidden_folders_version - [Required] String value version number. Must be comma values, not periods. IE: 1,0,0, NOT 1.0.0 <-- invalid.

Usage

At minimum you must specify the version numbers for show_file_ext_version and show_hidden_folders_version. The module defaults to show both hidden files/folders and file extensions.

Example

class { 'showhidden_win':
  show_file_ext_version       => '1,0,0',
  show_hidden_folders_version => '1,0,0',
  show_file_ext               => true, # Show file extensions
  show_hidden_folders         => true, # Show hidden files/folders
}

or

class { 'showhidden_win':
  show_file_ext_version       => '1,0,0',
  show_hidden_folders_version => '1,0,0',
  show_file_ext               => true, # Show file extensions
  show_hidden_folders         => false, # DON'T show hidden files/folders
}

or minimal usage

class { 'showhidden_win':
  show_file_ext_version       => '1,0,0',
  show_hidden_folders_version => '1,0,0',
}