Combreal

elevPS.psm1

Sep 17th, 2020 (edited)
1,625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. .SYNOPSIS
  3. This script start a powershell console as admaccount
  4. #>
  5.  
  6.  
  7. function elevPS {
  8.     $cred = Get-StoredCredential -Target admaccount
  9.     Start-Process powershell.exe -Credential $cred -ArgumentList "Start-Process powershell_ise.exe -Verb runAs"
  10. }
  11.  
  12. Export-ModuleMember -Function elevPS
Add Comment
Please, Sign In to add comment