[CmdletBinding()] param( [string]$Csv ) $ErrorActionPreference = 'Stop' if (Get-Command Get-BitLockerVolume -ErrorAction SilentlyContinue) { try { $volumes = @(Get-BitLockerVolume -ErrorAction Stop) } catch { Write-Warning "Get-BitLockerVolume недоступен без прав администратора: $_" & manage-bde.exe -status return } $rows = $volumes | Select-Object MountPoint, VolumeStatus, ProtectionStatus, EncryptionPercentage, EncryptionMethod, @{Name = 'KeyProtectorTypes'; Expression = { ($_.KeyProtector | ForEach-Object { $_.KeyProtectorType }) -join ', ' }} $rows | Format-Table -AutoSize if ($Csv) { $parent = Split-Path -Parent $Csv if ($parent -and -not (Test-Path -LiteralPath $parent)) { New-Item -ItemType Directory -Path $parent | Out-Null } $rows | Export-Csv -LiteralPath $Csv -NoTypeInformation -Encoding UTF8 Write-Host "Отчёт сохранён: $Csv" } } else { Write-Host 'Командлет Get-BitLockerVolume не найден, используется manage-bde.' & manage-bde.exe -status } Write-Host 'Recovery-пароли не выводятся. Настройки BitLocker не изменялись.'