以下是开启 BitLocker 的 PowerShell 脚本示例:

# 检查是否支持 BitLocker
if (!(Get-WindowsOptionalFeature -Online -FeatureName BitLocker).State -eq 'Enabled') {
    Write-Host "BitLocker 不受支持。请确保您的操作系统支持 BitLocker。"
    return
}

# 获取要加密的卷的驱动器号
$driveLetter = Read-Host "请输入要加密的卷的驱动器号(例如 C:)"

# 启用 BitLocker
$encryptionStatus = Get-BitLockerVolume -MountPoint $driveLetter | Select-Object -ExpandProperty EncryptionPercentage
if ($encryptionStatus -eq $null) {
    Write-Host "正在启用 BitLocker..."
    Enable-BitLocker -MountPoint $driveLetter -EncryptionMethod Aes256 -UsedSpaceOnly
    Write-Host "BitLocker 已成功启用。"
} else {
    Write-Host "BitLocker 已在此卷上启用。"
}

请注意,运行此脚本需要管理员权限

windwos 开启bitlocker powershell脚本

原文地址: http://www.cveoy.top/t/topic/ilDo 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录