有谁知道是否有一个注册表标志可以用来检测 Windows 恢复环境是否启用或禁用?
目前,我在应用程序部署的“检查要求”部分中使用此脚本:
<#
.SYNOPSIS
Detects if a Windows Recovery Partition needs to be setup
.DESCRIPTION
Uses powershell to check if WinRE is enabled
.NOTES
To be used in the Endpoint Manager and as the remidiation script
#>
try {
$reagentcOutput = reagentc /info
# Check if Recovery is already enabled
if ($reagentcOutput -match "Enabled") {
Write-Output "Enabled"
exit 0
} else {
Write-Output "Not"
exit 0
}
}
catch {
Write-Host "An Error occured! Hopefully this helps: $reagentcOutput"
Write-Host "ERROR: at $($_.InvocationInfo.ScriptLineNumber)"
Write-Error "Message: " $_.Exception.Message
Write-Host "StackTrace: "
Write-Host $_.Exception.StackTrace
Write-Host ""
exit 1
}
exit 0
但问题似乎是 Intune 没有按照我预期的方式评估此脚本的返回,或者脚本的语法或执行存在其他问题。我找不到任何工作需求脚本的示例。
本质上,我只是想添加一个“要求”,即在评估安装应用程序(配置分区并移动 WinRE img 文件)之前,WinRE 尚未启用