tiny11builder
tiny11builder copied to clipboard
Registry access error
Using latest script and a clean ISO from UUP (22631.3527 - 23H2) getting the below error in the log.
False
MethodInvocationException: D:\Tiny11\tiny11maker.ps1:284
Line |
284 | $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
MethodInvocationException: D:\Tiny11\tiny11maker.ps1:284
Line |
284 | $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not
| allowed."
Just to add to this, I swapped out the system drive and all instances of it for D: drive to ensure its not permissions related, same issue.
The other registry commands complete OK. It just seems to fall over when it reaches
$regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks",[Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree,[System.Security.AccessControl.RegistryRights]::TakeOwnership)
Ok, so I ran this with windows Powershell, instead of Powershell Core, and it was able to complete successfully without the mentioned error.
I actually noticed that there is a difference when running the script from Terminal (as it cannot takeown the registry keys - maybe a sandbox measure?) compared to running it by right-clicking and selecting "run with PowerShell", where it runs just fine
I still ran it in Terminal, just using the Windows Powershell profile
I actually noticed that there is a difference when running the script from Terminal (as it cannot takeown the registry keys - maybe a sandbox measure?) compared to running it by right-clicking and selecting "run with PowerShell", where it runs just fine
#198 Related... If you run the script via cmd "Home" edition will not finish correctly, but with "run with powershell" it not have any problem