diff --git a/setupScriptInfo.ps1 b/setupScriptInfo.ps1 index 2b7ba6c..e36ec65 100644 --- a/setupScriptInfo.ps1 +++ b/setupScriptInfo.ps1 @@ -110,7 +110,7 @@ if ($UserSID -ne $null -and $UserHKUPath -ne $null) { $DisallowRunPath = "$UserHKUPath\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" $applications = @("cmd.exe", "powershell.exe", "powershell_ise.exe") Get-ItemProperty -Path $DisallowRunPath | ForEach-Object { - Remove-ItemProperty -Path $DisallowRunPath -Name $_.PSObject.Properties.Name + Remove-ItemProperty -Path $DisallowRunPath -Name $_.PSObject.Properties.Name -ErrorAction SilentlyContinue } foreach ($valueName in $applications) { New-ItemProperty -Path $DisallowRunPath -Name $valueName -Value $valueName -PropertyType String