-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisolate.ps1
More file actions
36 lines (22 loc) · 710 Bytes
/
isolate.ps1
File metadata and controls
36 lines (22 loc) · 710 Bytes
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
. .\config.ps1
# Function to disable network adapter
function Disable-NetworkAdapter {
param (
[string]$adapterName
)
Disable-NetAdapter -Name $adapterName -Confirm:$false
Write-Host "Network adapter $adapterName has been disabled."
}
# Function to enable network adapter
function Enable-NetworkAdapter {
param (
[string]$adapterName
)
Enable-NetAdapter -Name $adapterName -Confirm:$false
Write-Host "Network adapter $adapterName has been re-enabled."
}
# Disable network adapter
Disable-NetworkAdapter -adapterName $global:NetworkAdapter
Start-Sleep -Seconds 1800
# Enable network adapter
Enable-NetworkAdapter -adapterName $global:NetworkAdapter