Forum Discussion
PowerShell script not updating policies
First thing I need to enable the policy but I am not able to do so.
Policy mention above:
https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.DeviceInstallation::DeviceInstall_Classes_Allow
I am running the following command:
New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions" -Force | Out-Null
New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions" -Name "AllowDeviceClasses" -Value 1 -Type DWord -Force
The first command is creating the path on the registry editor, the second one is adding the value "1" to enable the policy, and the last one updating the policies.
The policy in question is the:
"Allow installation of devices using drivers that match these device setup classes"
What I have tried so far, didn't help me. Not even ChatGPT could help me on this one. Hope some of you guys can help me.