Commit 64165415 authored by Jos Lieben's avatar Jos Lieben

don't try to self-elevate

parent 015dea7e
......@@ -38,9 +38,9 @@ Param(
write-Output "$Name Powershell module not installed...trying to Install, this will fail in an unelevated session"
#Check if elevated
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")){
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Write-Output "Please restart this script in elevated mode!"
Read-Host "Press any key to continue"
Install-Module $Name -SkipPublisherCheck -Force -Confirm:$False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment