Guest User

Untitled

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. ##############################
  2. #.SYNOPSIS
  3. # Launches new PowerShell with elevated permissions
  4. #
  5. #.DESCRIPTION
  6. # Launches new PowerShell with elevated permissions which is handy for when you find yourself in a normal prompt
  7. # and realise you should have been running as admin, a slight work around for the lack of SUDO
  8. #
  9. #.EXAMPLE
  10. # Start-PowerShellAsAdmin
  11. #
  12. #.NOTES
  13. # Add this to your PowerShell profile ($profile) to ensure its always available
  14. # Doesn't set the location, yet..
  15. ##############################
  16.  
  17. Function Start-PowerShellAsAdmin() {
  18. Start-Process PowerShell -Verb RunAs
  19. }
  20. # Create an alias for a more command friendly experience
  21. Set-Alias -Name psadmin -value Start-PowerShellAsAdmin
Add Comment
Please, Sign In to add comment