Create RunOnce
key if inexistent
This commit is contained in:
parent
5e27e16a85
commit
b61c6d1d60
1 changed files with 7 additions and 1 deletions
|
@ -81,7 +81,13 @@ class Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
Push-Location $userKey.PSPath;
|
Push-Location $userKey.PSPath;
|
||||||
$result = Get-Item "Software\Microsoft\Windows\CurrentVersion\RunOnce";
|
$runOncePath = "Software\Microsoft\Windows\CurrentVersion\RunOnce";
|
||||||
|
|
||||||
|
if (-not (Test-Path $runOncePath)) {
|
||||||
|
New-Item $runOncePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = Get-Item $runOncePath;
|
||||||
Pop-Location;
|
Pop-Location;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue