added Powershellscript für Windows
This commit is contained in:
parent
194584d951
commit
2f09a6e784
28
WireWin.ps1
Normal file
28
WireWin.ps1
Normal file
@ -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
|
||||||
Loading…
x
Reference in New Issue
Block a user