Since I can't find any alternative to Linux' sudo
elevation command, I have the following question:
How to define a PowerShell function which requires elevation? I mean UAC prompt.
Say, such function follows:
function system-check {
SFC /ScanNow
}
System:
Windows 8.1 Pro 64-bit
PowerShell:
Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 117
EDIT1:
To be 100% understandable let me rephrase:
- I run PowerShell as user
- I run the aforementioned function
system-check
- I want the function to elevate in order to be able to execute the command; note, that I want the UAC prompt to appear