内容へ移動
Chat GPTでつくったスクリプトや設定の共有とかメモ
ユーザ用ツール
ユーザー登録
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ユーザー登録
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
トレース:
powershell:落書き3
文書の過去の版を開いています
。もしこのまま保存すると、この文書が最新となります。
メディアファイル
<code> # 定義: DFビットを立ててpingを実行する関数 function Test-MTU { param ( [string]$Target, [int]$StartMTU = 800, [int]$EndMTU = 1000 ) $results = @() for ($mtu = $StartMTU; $mtu -le $EndMTU; $mtu++) { $pingResult = Test-Connection -ComputerName $Target -Count 1 -BufferSize $mtu -DontFragment -ErrorAction SilentlyContinue if ($pingResult.StatusCode -eq 0) { $results += "MTU: $mtu - Success" } else { $results += "MTU: $mtu - Failure" } } return $results } # example.comに対してMTUを800から1000の範囲でテスト $target = "example.com" $mtuResults = Test-MTU -Target $target # 全インターフェイスのMTUおよびMRU設定を取得 $interfaces = Get-NetAdapter | Select-Object -Property Name, MacAddress, LinkSpeed, InterfaceDescription $mtuSettings = $interfaces | ForEach-Object { $interfaceName = $_.Name $mtu = Get-NetIPInterface -InterfaceAlias $interfaceName | Select-Object -ExpandProperty NlMtu [PSCustomObject]@{ Interface = $interfaceName MTU = $mtu } } # 結果をファイルに書き出し $logFile = "mtu-result.txt" $mtuResults | Out-File -FilePath $logFile Add-Content -Path $logFile -Value "`nCurrent MTU Settings:`n" $mtuSettings | Format-Table -AutoSize | Out-String | Add-Content -Path $logFile Write-Host "Results saved to $logFile" </code>
保存
プレビュー
キャンセル
編集の概要
powershell/落書き3.1720148064.txt.gz
· 最終更新: 2024/07/05 02:54 by
133.106.51.50
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ