ユーザ用ツール

サイト用ツール


powershell:落書き3

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
powershell:落書き3 [2024/06/08 10:52] 128.22.160.91powershell:落書き3 [2024/07/05 03:03] (現在) 133.106.51.50
行 1: 行 1:
-適当 +<code>
-オンライン64Bit https://dl.google.com/tag/s/app=x64-stable-statsdef_1/update2/installers/ChromeSetup.exe+
  
-https://dl.google.com/tag/s/app=x64-stable-statsdef_1/chrome/install/ChromeStandaloneSetup64.exe+# 定義DFビットを立ててpingを実行する関数 
 +function Test-MTU { 
 +    param ( 
 +        [string]$Target, 
 +        [int]$StartMTU = 800, 
 +        [int]$EndMTU = 1000 
 +    )
  
-ドアロン32Bit(exe) https://dl.google.com/tag/s/app=stable-arch_x86-statsdef_1/chrome/install/ChromeStandaloneSetup.exe+    $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> 
 + 
 +<code> 
 +# PowerShellスクリプト 
 + 
 +function Test-MTU { 
 +    param ( 
 +        [string]$hostname, 
 +        [int]$minMTU, 
 +        [int]$maxMTU 
 +    ) 
 + 
 +    $logFile = "mtu-result.txt" 
 +    Remove-Item $logFile -ErrorAction SilentlyContinue 
 + 
 +    function Ping-Host { 
 +        param ( 
 +            [string]$host, 
 +            [int]$size 
 +        ) 
 + 
 +        $pingResult = Test-Connection -ComputerName $host -Count 4 -BufferSize $size -DontFragment -Quiet 
 +        return $pingResult 
 +    } 
 + 
 +    function BinarySearch-MTU { 
 +        param ( 
 +            [string]$host, 
 +            [int]$low, 
 +            [int]$high 
 +        ) 
 + 
 +        while ($low -le $high) { 
 +            $mid = [math]::Floor(($low + $high) 2) 
 + 
 +            if (Ping-Host -host $host -size $mid) { 
 +                $low = $mid + 1 
 +            } else { 
 +                $high = $mid - 1 
 +            } 
 +        } 
 +        return $high 
 +    } 
 + 
 +    # 最適なMTUサイズを探す 
 +    $optimalMTU = BinarySearch-MTU -host $hostname -low $minMTU -high $maxMTU 
 +    "Optimal MTU size for $hostname is $optimalMTU" | Out-File -FilePath $logFile -Append 
 + 
 +    # 現在のすべてのインターフェイスのMTUおよびMRU設定を取得 
 +    $interfaces = Get-NetIPInterface 
 +    foreach ($interface in $interfaces) { 
 +        $interfaceInfo = "Interface: $($interface.InterfaceAlias), MTU: $($interface.NlMtu), MRU: $($interface.NlMtu)" # Note: Windows does not expose MRU directly, typically MRU == MTU 
 +        $interfaceInfo | Out-File -FilePath $logFile -Append 
 +    } 
 +
 + 
 +# 設定 
 +$hostname = "example.com
 +$minMTU = 800 
 +$maxMTU 1000 
 + 
 +# 実行 
 +Test-MTU -hostname $hostname -minMTU $minMTU -maxMTU $maxMTU 
 + 
 +</code>
  
-https://download.mozilla.org/?product=firefox-stub&os=win&lang=ja&_gl=1*1jkogrc*_ga*NzM2NzE2NjIzLjE3MTc4NDM4OTc.*_ga_MQ7767QQQW*MTcxNzg0MzkxOC4xLjAuMTcxNzg0MzkxOC4wLjAuMA.. 
powershell/落書き3.1717843964.txt.gz · 最終更新: 2024/06/08 10:52 by 128.22.160.91

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki