Allow registering startup script for the default user
This commit is contained in:
parent
18abc9e499
commit
682571eeba
1 changed files with 17 additions and 9 deletions
|
@ -70,6 +70,8 @@ $null = New-Module {
|
|||
param(
|
||||
[Parameter(ParameterSetName="System")]
|
||||
[switch] $System,
|
||||
[Parameter(ParameterSetName="DefaultUser", Mandatory)]
|
||||
[switch] $DefaultUser,
|
||||
[Parameter(ParameterSetName="User", Mandatory)]
|
||||
[switch] $User,
|
||||
[Parameter(ParameterSetName="User")]
|
||||
|
@ -77,6 +79,18 @@ $null = New-Module {
|
|||
[RegistryKey] $UserKey
|
||||
)
|
||||
|
||||
if ($DefaultUser.IsPresent) {
|
||||
Edit-DefaultUserKey {
|
||||
param(
|
||||
[RegistryKey] $Key
|
||||
)
|
||||
|
||||
Register-Setup -UserKey $Key;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($User.IsPresent -or $UserKey) {
|
||||
if (-not $UserKey) {
|
||||
$UserKey = Get-Item "HKCU:\";
|
||||
|
@ -159,15 +173,9 @@ $null = New-Module {
|
|||
[switch] $CurrentUser
|
||||
)
|
||||
|
||||
if ($DefaultUser.ToBool()) {
|
||||
Edit-DefaultUserKey {
|
||||
param(
|
||||
[RegistryKey] $Key
|
||||
)
|
||||
|
||||
Register-Setup -UserKey $Key;
|
||||
}
|
||||
} elseif ($CurrentUser.ToBool()) {
|
||||
if ($DefaultUser.IsPresent) {
|
||||
Register-Setup -DefaultUser;
|
||||
} elseif ($CurrentUser.IsPresent) {
|
||||
Register-Setup -User;
|
||||
} else {
|
||||
Register-Setup;
|
||||
|
|
Loading…
Reference in a new issue