Allow skipping the User parameter

This commit is contained in:
Manuel Thalmann 2024-08-10 03:40:37 +02:00
parent ff9a3eeedc
commit 2b8a386f79

View file

@ -78,10 +78,11 @@ $null = New-Module {
[Parameter(ParameterSetName="User", Mandatory)]
[switch] $User,
[Parameter(ParameterSetName="User")]
[Parameter(ParameterSetName="SpecificUser", Mandatory)]
[RegistryKey] $UserKey
)
if ($User.IsPresent) {
if ($User.IsPresent -or $UserKey) {
if (-not $UserKey) {
$UserKey = Get-Item "HKCU:\";
}