Update enable-bitlocker.ps1
This commit is contained in:
1 parent
b3484598ff
commit
f95749cd3d
1 file changed
+2
-5
@@ -11,14 +11,11 @@ if ($bitlockerStatus.ProtectionStatus -eq "On") {
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Add Windows Forms assembly
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
|
||||
# Prompt user to select save location for recovery key
|
||||
$saveDialog = [System.Windows.Forms.SaveFileDialog]::new()
|
||||
$saveDialog = New-Object System.Windows.Forms.SaveFileDialog
|
||||
$saveDialog.Filter = "Text Files (*.txt)|*.txt"
|
||||
$saveDialog.Title = "Select location to save BitLocker recovery key"
|
||||
$saveDialog.FileName = "BitLocker-RecoveryKey-$env:COMPUTERNAME-$(Get-Date -Format 'yyyy-MM-dd').txt"
|
||||
$saveDialog.FileName = "BitLocker-RecoveryKey-$(Get-Date -Format 'yyyy-MM-dd').txt"
|
||||
|
||||
if ($saveDialog.ShowDialog() -eq 'OK') {
|
||||
$keyPath = $saveDialog.FileName
|
||||
|
||||
Reference in new issue
Block a user