powershell sudo equivalent code example

Example: powershell sudo equivalent

runas [{/profile | /noprofile}] [/env] [{/netonly | /savecred}] [/smartcard] [/showtrustlevels] [/trustlevel] /user:<UserAccountName> "<ProgramName> <PathToProgramFile>"

## FLAGS
# /profile - Loads the user's profile. this is turned on by default.

#/no profile - Specifies that the user's profile is not to be loaded.
#This allows the application to load more quickly, 
#but it can also cause a malfunction in some applications.

# EXAMPLES
runas /user:<localmachinename>\administrator cmd

runas /user:[email protected] "notepad my_file.txt"