Start an application as Administrator
Version : 1.0
File Name : elevate.ps1
Author : Adewale Azeez - iamthecarisma@gmail.com
Date : April-01-2020
Start an application as Administrator, the first argument is the name of the app to run. The following arguments are sent to the application.
elevate [[-App] <String>] [[-ExtraArguments] <String[]>]
[<CommonParameters>]
The application to run as Administrator
attr |
value |
---|---|
Required? |
false |
Position? |
1 |
Default value |
|
Accept pipeline input? |
false |
Accept wildcard characters? |
false |
The arguments to pass to the application
attr |
value |
---|---|
Required? |
false |
Position? |
2 |
Default value |
|
Accept pipeline input? |
false |
Accept wildcard characters? |
false |
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
System.String
[System.String]
elevate notepad
Start the notepad app as Administrator
elevate cmd /k dir
Start Windows command prompt as Administrator and run the command ‘dir’.