Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function HasAdministratorRights {
  2. ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
  3. }
  4.  
  5. if (-Not (HasAdministratorRights)) {
  6. Start-Process powershell $MyInvocation.MyCommand.Definition -Verb RunAs
  7. Exit
  8. }
  9.  
  10. Lock-BitLocker -MountPoint ($PSScriptRoot.Substring(0, 2)) -ForceDismount
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement