-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwlanProfilImport.ps1
39 lines (26 loc) · 1.83 KB
/
wlanProfilImport.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<#
wlanProfilImport.ps1
.DESCRIPTION
Impoertiert WLAN-Profile
aus dem Scriptverzeinis
https://github.com/thelamescriptkiddiemax/soest
#>
#--- Variablen ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$wlanProfil = "wlan.xml" # Zu importierendes Profil
$importuser = "all" # all oder current
#--- Vorbereitung -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$stringhost = [System.String]::Concat("`n", "[ ", $env:UserName, " @ ", $env:computername, " @ ", ((Get-WmiObject Win32_ComputerSystem).Domain), " @ Windows 10: ",
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" -Name ReleaseID).ReleaseId), " ] ", (Get-Date -Format "dd/MM/yyyy HH:mm:ss"), "`n", "[ ", $MyInvocation.MyCommand.Name, " ]", "`n","`n")
$stringimport1 = [System.String]::Concat(" Importiere WLAN-Profil [ ", $wlanProfil, " ] ", "`n")
$stringimport2 = [System.String]::Concat(" Import von WLAN-Profil [ ", $wlanProfil, " ] erledigt!", "`n")
$importprofil = "$PSScriptRoot\$wlanProfil"
#--- Verarbeitung -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Clear-Host
Write-Host $stringhost -ForegroundColor Magenta
Write-Host $stringimport1
Start-Sleep -Seconds 1.5
netsh wlan add profile filename=$importprofil user=$importuser
Clear-Host
Write-Host $stringhost -ForegroundColor Magenta
Write-Host $stringimport2
Start-Sleep -Seconds 1.5