This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Utility script to remove custom console customizations from shortcuts and additionally adjusts permissions to block them from being re–added. | |
.DESCRIPTION | |
This script can take a set of shortcuts from the pipeline or optionally crawl the user’s start menu for shortcuts having an embedded `CONSOLE_PROPS` data block. Shortcuts that have the datablock are stripped of its `CONSOLE_PROPS` then, if enabled, its permission inheritance is disabled, then changed to deny the user write access to the shortcut. In effect, this prevents re–adding the `CONSOLE_PROPS` to the shortcut and prevents the shortcut from diverging from the default terminal settings on the user. | |
If specified, this script will also remove any console customizations in the registry. Note: Denying subkey creation on `HKCU:\Console` will break some installers expecting to create subkeys here. |