Skip to content

Instantly share code, notes, and snippets.

@TakamiChie
Created March 19, 2024 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakamiChie/7ba3dfe9f91088f8f6ed0305ba46a671 to your computer and use it in GitHub Desktop.
Save TakamiChie/7ba3dfe9f91088f8f6ed0305ba46a671 to your computer and use it in GitHub Desktop.
イーサネットを一時的に止めるスクリプト
// 管理者として実行する必要がある。 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