Update setupScriptInfo.ps1

This commit is contained in:
2023-10-23 12:35:45 +00:00
parent 3703ff1307
commit 6480159106

View File

@@ -121,9 +121,11 @@ if ($UserSID -ne $null -and $UserHKUPath -ne $null) {
$DisallowRunKeyPath = "$UserHKUPath\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
$DisallowRunValueName = "DisallowRun"
SetRegistry -regpath $DisallowRunKeyPath -regproperty $DisallowRunValueName
Write-Host (Get-ItemProperty -Path "$UserHKUPath\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun")
$DisallowRunPath = "$UserHKUPath\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun"
if (-not (Test-Path -Path "Registry::$DisallowRunPath" -PathType Container)) {
New-Item -Path "Registry::$DisallowRunPath" -Force
}
$applications = @("cmd.exe", "powershell.exe", "powershell_ise.exe")
Get-ItemProperty -Path $DisallowRunPath | ForEach-Object {
Remove-ItemProperty -Path $DisallowRunPath -Name $_.PSObject.Properties.Name -ErrorAction SilentlyContinue