-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTurn_on_wlan.ps1
28 lines (18 loc) · 1.03 KB
/
Turn_on_wlan.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
#Declaration
$Computer= Read-Host -Prompt "Enter PC Name"
$cred= Get-Credential -Message "Enter your TA Account"
$Get_Status= Invoke-Command -Computer $Computer -Credential $cred -Scriptblock {Get-NetAdapter | Where status -ne up }
#Enable PS Remoting temporarily/On Next windows start it will be disabled
#Start-Process "cmd.exe" "/c .\Enable-remoting.bat" -Wait
cls
Invoke-Command -Computer $Computer -Credential $cred -Scriptblock {Get-NetAdapter | Where status -ne up }
#Process for enabling
$Determine= Read-Host -Prompt "
Enter 1 for enable 2 for exit
"
if ($Determine -eq '1') {
Invoke-Command -Computer $Computer -Credential $cred -Scriptblock {Get-NetAdapter |Where status -ne up | Enable-NetAdapter }
Invoke-Command -Computer $Computer -Credential $cred -Scriptblock {Get-NetAdapter | Where status -ne up }
}
else { exit }