"
Code
"
$registryPaths = @(
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\UserChoice",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice",
"HKCU:\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice",
"HKCU:\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice"
)
$desiredValue = "MSEdgeHTM"
foreach ($registryPath in $registryPaths) {
if (Test-Path $registryPath) {
$actualValue = (Get-ItemProperty -Path $registryPath).ProgId
if ($actualValue -ne $desiredValue) {
# Значение не совпадает, возвращаем код неудачного завершения (1)
exit 1
}
} else {
# Ключ реестра не существует, возвращаем код неудачного завершения (1)
exit 1
}
}
# Все значения найдены, возвращаем код успешного завершения (0)
exit 0