Get-BitlockerVolume $Title = "" $Message = "What do you want to do?" $Decrypt = New-Object System.Management.Automation.Host.ChoiceDescription "&Decrypt", "Decrypt" $Encrypt = New-Object System.Management.Automation.Host.ChoiceDescription "&Encrypt", "Encrypt" $Exit = New-Object System.Management.Automation.Host.ChoiceDescription "&Exit", "Exit" $Options = [System.Management.Automation.Host.ChoiceDescription[]]($Decrypt, $Encrypt, $Exit) do { $Action = $host.ui.PromptForChoice($title, $message, $options, 0) switch($Action) { 0 {$Drive = Read-Host -Prompt 'Which drive do you want to decrypt?'; Unlock-BitLocker -MountPoint $Drive":" -Password (Read-Host "Enter your password:" -AsSecureString)} 1 {$Drive = Read-Host -Prompt 'Which drive do you want to encrypt?'; Lock-BitLocker -MountPoint $Drive":"} 2 {Write-Host "Exiting script";Start-Sleep -Seconds 3} } } While ($Action -ne 2)