Files
2024-07-12 09:55:05 +02:00

14 lines
458 B
PowerShell

try{
if (Test-Path -LiteralPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location") {
$value = Get-ItemPropertyValue -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location' -Name 'Value' -ErrorAction SilentlyContinue
if ($value -eq 'Allow') {
write-host "Success"
exit 0
}
}
}
catch{
$errMsg = $_.Exception.Message
write-host $errMsg
exit 1
}