diff --git a/WireWin.ps1 b/WireWin.ps1 new file mode 100644 index 0000000..7a7b2e6 --- /dev/null +++ b/WireWin.ps1 @@ -0,0 +1,28 @@ +# Überprüfe ob powershellscripte ausgeführt werden dürfen +if ((Get-ExecutionPolicy) -eq "Restricted") { + Set-ExecutionPolicy RemoteSigned +} + +# Überprüfe ob chocolatey installiert ist +if (!(Get-Command choco.exe -ErrorAction SilentlyContinue)) { + # Install Chocolatey + Set-ExecutionPolicy Bypass -Scope Process -Force + iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) +} + +# Installiere Wireguard mit chocolatey +choco install wireguard -y + +New-Item -ItemType File -Path "C:\Program Files\WireGuard\Data\Configurations\wg0.conf" + +# Eingabe für die Wireguard Configuration: +$config = Read-Host "Gebe hier die Wireguard Konfiguration ein: (Zweimal auf Enter drücken zum bestätigen)" + +# Füge die Konfiguration an die wg0.conf an +Add-Content -Path "C:\Program Files\WireGuard\Data\Configurations\wg0.conf" -Value $config + +reg add HKLM\Software\WireGuard /v LimitedOperatorUI /t REG_DWORD /d 1 /f + +$usertoadd = Read-Host "Gebe den Nutzernamen ein: (Zweimal auf Enter drücken zum bestätigen)" + +Add-LocalGroupMember -Group 'Netzwerkkonfigurations-Operatoren' -Member '$usertoadd' -Verbose \ No newline at end of file