This example creates a code block that contains commands which modify the registry. This code block then gets assigned to a variable. The variable is passed into a command, called 'Invoke-HKCURegistrySettingsForAllUsers', that will apply 'Current User' registry settings to all current and future users of the machine. This allows PSADT-deployed apps to be correctly configured for all users in an enterprise system lab environment.
$HKCURegistrySettings = {
Set-RegistryKey -Key 'HKEY_CURRENT_USER\SOFTWARE\Classes\AppX4hxtad77fbk3jkkeerkrm0ze94wjf3s9' -Name 'NoOpenWith' -Value '""'-Type String -ContinueOnError:$True
}
Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings