Преглед изворни кода

update bootstrap with admin rights and remove legacy packages

Tobias Simetsreiter пре 3 година
родитељ
комит
261c15d785
1 измењених фајлова са 6 додато и 3 уклоњено
  1. 6 3
      bootstrap.ps1

+ 6 - 3
bootstrap.ps1

@@ -1,5 +1,11 @@
 
 # Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://<myurl>/bootstrap.ps1'))
+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
+  Break
+}
 
 Set-ExecutionPolicy Bypass -Scope Process -Force
 
@@ -13,11 +19,8 @@ choco upgrade -y `
     7zip `
     openvpn `
     putty `
-    ubuntuhere `
     virtualbox `
     winscp `
-    wsl2 `
-    wsltty `
 
 
 $User = Read-Host -Prompt 'Done. Close?'