Update setupScriptInfo.ps1
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user