Created
March 19, 2024 09:32
-
-
Save TakamiChie/7ba3dfe9f91088f8f6ed0305ba46a671 to your computer and use it in GitHub Desktop.
イーサネットを一時的に止めるスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 管理者として実行する必要がある。 gsudo インストール済みなら sudo ./Pause_Ethernet.ps1 | |
param( | |
[int]$seconds = 3 | |
) | |
Disable-NetAdapter -Name "イーサネット" -Confirm:$false | |
Write-Host 切断しました。 | |
Write-Host ${seconds}秒後に再接続します。 | |
Start-Sleep -Seconds $seconds | |
Enable-NetAdapter -Name "イーサネット" -Confirm:$false | |
Write-Host 接続しました。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment