SHARE
TWEET

Untitled

a guest Jun 18th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. param(
  2.         [string]$interface,
  3.         [string]$action,
  4.         [string]$mtu
  5. )
  6.  
  7. $settings_on = @{
  8.         "IPv4 Checksum Offload"="Rx & Tx Enabled"
  9.         "Large Send Offload V2 (IPv4)"="Enabled"
  10.         "Large Send Offload V2 (IPv6)"="Enabled"
  11.         "Offload.Rx.Checksum"="All"
  12.         "Offload.Tx.Checksum"="All"
  13.         "Offload.Tx.LSO"="Maximal"
  14.         "TCP Checksum Offload (IPv4)"="Rx & Tx Enabled"
  15.         "TCP Checksum Offload (IPv6)"="Rx & Tx Enabled"
  16.         "UDP Checksum Offload (IPv4)"="Rx & Tx Enabled"
  17.         "UDP Checksum Offload (IPv6)"="Rx & Tx Enabled"
  18. }
  19.  
  20. foreach ($key in $settings_on.keys) {
  21.         $value = "Disabled"
  22.         if ($action -eq "on") {
  23.                 $value = $settings_on[$key]
  24.         }
  25.  
  26.         Set-NetAdapterAdvancedProperty $interface -DisplayName $key -DisplayValue $value -NoRestart
  27. }
  28.  
  29. Set-NetAdapterAdvancedProperty $interface -DisplayName "Init.MTUSize" -DisplayValue $mtu
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top