title: Check if Protection Status is On then disable Bitlocker using PowerShell
body: <p>Hi I am trying to make a script that will check Bitlocker status. If Protection status is On, it will disable Bitlocker.</p>
  <pre><code>Get-BitLockerVolume | select ProtectionStatus | ForEach-Object {$_.ProtectionStatus
      if($_.ProtectionStatus -like &quot;On&quot;)
      {
          Disable-BitLocker -MountPoint $_.MountPoint
      }
      else
      {
          Break
      }
  }
  </code></pre>
  <p>but I got message issues</p>
  <pre><code>Disable-BitLocker : Cannot validate argument on parameter 'MountPoint'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
  At line:4 char:39
  +         Disable-BitLocker -MountPoint $_.MountPoint
  +                                       ~~~~~~~~~~~~~
      + CategoryInfo          : InvalidData: (:) [Disable-BitLocker], ParameterBindingValidationException
      + FullyQualifiedErrorId : ParameterArgumentValidationError,Disable-BitLocker
  </code></pre>
  <p>How can I fix the script? Thanks</p>