Professional Documents
Culture Documents
.NAME
Tweaking Adapter
#>
$Form.controls.AddRange(@($cb_AdapterNamesCombo,$Label1,$Label2,$lbl_Path,
$Label3,$lbl_ndisver,$Groupbox1,$btn_apply,$btn_unqueues,$btn_openreg,
$Groupbox2,$btn_applyglobal,$Groupbox3,$btn_applyadv,$btn_adaptrest,
$Groupbox5,$Groupbox4,$btn_applypowersettings,$Groupbox7,$btn_applyall,
$Groupbox6,$btn_applyInterfaceSettings,$cb_IPv6,$cb_IPv4,$btn_rssaddsupport,
$Groupbox8,$btn_registrytweaksapply,$btn_Opacity,$btn_InterruptApply))
$Groupbox1.controls.AddRange(@($Label4,$Label5,$Label6,$lbl_rssstatus,
$cb_rss_onoff,$cb_rssqueues,$cb_rssprofile,$Label7,$cb_rssbaseproc,
$Label8,$cb_rssmaxproc,$Label9,$cb_rssmaxprocs,$Label35,$cb_DisablePortScaling,
$Label42,$cb_ManyCoreScaling))
$Groupbox2.controls.AddRange(@($Label10,$cb_osrss,$Label11,$cb_osrsc,
$Label12,$cb_oschimney,$Label13,$cb_ostaskoff,$cb_osntd,$Label14,$cb_osntdais,
$Label15,$cb_ospcf,$Label16))
$Groupbox3.controls.AddRange(@($Label17,$cb_flowcontrol,
$Label18,$Label19,$Label20,$Label21,$Label22,$Label23,$cb_InterruptModeration,
$cb_IPChecksumOffloadIPv4,$cb_TCPChecksumOffloadIPv4,$cb_TCPChecksumOffloadIPv6,$cb
_UDPChecksumOffloadIPv4,$cb_UDPChecksumOffloadIPv6,$Label24,$cb_InterruptModeration
Rate,
$Label25,$Label26,$cb_LsoV2IPv4,$cb_LsoV2IPv6,$Label27,$cb_LsoV1IPv4,$Label28,$cb_P
MNSOffload,$Label29,$cb_PMARPOffload,$cb_PriorityVLANTag,
$Label00,$Label30,$cb_ReceiveBuffers,$Label31,$cb_TransmitBuffers,
$Label73,$tb_TxIntDelay,$Label74,$cb_PacketDirect,$Label75,$cb_EnableCoalesce,
$Label76,$cb_EnableUdpTxScaling,$Label68,$cb_CoalesceBufferSize))
$Groupbox5.controls.AddRange(@($Label32,$Label33,$cb_tcpiprssbasecpu,
$cb_ndisrssbasecpu))
$Groupbox4.controls.AddRange(@($Label34,$cb_EnablePME,
$Label36,$cb_EnableDynamicPowerGating,$Label37,$cb_EnableConnectedPowerGating,
$Label38,$cb_AutoPowerSaveModeEnabled,$cb_NicAutoPowerSaver,
$Label39,$Label40,$cb_DisableDelayedPowerUp,$Label41,$cb_ReduceSpeedOnPowerDown))
$Groupbox7.controls.AddRange(@($Label44,$cb_AdvertiseDefaultRoute,
$Label45,$cb_Advertising,$Label46,$cb_AutomaticMetric,$cb_ClampMss,
$Label47,$cb_DirectedMacWolPattern,$Label48,$Label49,$cb_EcnMarking,
$Label50,$cb_ForceArpNdWolPattern,$Label51,$cb_Forwarding,$cb_IgnoreDefaultRoutes,
$Label52,$Label53,$cb_ManagedAddressConfiguration,
$Label54,$cb_NeighborDiscoverySupported,
$Label55,$cb_NeighborUnreachabilityDetection,
$Label56,$cb_OtherStatefulConfiguration,$Label57,$cb_RouterDiscovery,
$Label58,$cb_Store,$Label59,$cb_WeakHostReceive,$Label60,$cb_WeakHostSend,
$Label61,$tb_CurrentHopLimit,$Label62,$tb_BaseReachableTime,$tb_ReachableTime,
$Label63,$Label64,$tb_DadRetransmitTime,$Label65,$tb_DadTransmits,
$Label66,$tb_NlMtu,$Label67,$tb_RetransmitTime,
$Label69,$Label70,$Label71,$Label72))
$Groupbox6.controls.AddRange(@($lb_MsiMode,$cb_MsiMode,$lb_InterruptPriority,
$cb_InterruptPriority,$lb_DevicePolicy,$cb_DevicePolicy))
$Groupbox8.controls.AddRange(@($Label43,$Label77,$cb_Afd_defaultrecWin,
$cb_Afd_defaultSendWin,$Label78,$cb_DisableAddressSharing,
$Label79,$cb_DoNotHoldNICBuffers,$Label80,$cb_SmallBufferSize,
$Label81,$cb_MediumBufferSize,$Label82,$cb_LargeBufferSize,
$Label83,$cb_HugeBufferSize,$cb_BufferAlignment,$Label84,$cb_BufferMultiplier,
$Label85,$Label86,$cb_SmallBufferListDepth,$Label87,$cb_MediumBufferListDepth,
$Label88,$cb_LargBufferListDepth,$Label89,$cb_DisableChainedReceive,
$Label90,$cb_DisableDirectAcceptEx,$Label91,$cb_DisableRawSecurity,
$Label92,$cb_DynamicSendBufferDisable,$Label93,$cb_FastSendDatagramThreshold,
$Label94,$cb_FastCopyReceiveThreshold,$Label95,$cb_IgnorePushBitOnReceives,
$Label96,$cb_IgnoreOrderlyRelease,$Label97,$cb_TransmitWorker,
$Label98,$cb_PriorityBoost))
#region Logic
#Cleaning Code
cls
Add-Type -Name Window -Namespace Console -MemberDefinition '
[DllImport("Kernel32.dll")]
public static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow);'
#GUI Settings
#$ErrorActionPreference="Stop"
#$Form.Opacity = "0.90"
#Groupboxes
$Groupbox1.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox1.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
$Groupbox2.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox2.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
$Groupbox3.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox3.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
$Groupbox4.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox4.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
$Groupbox5.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox5.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
$Groupbox7.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox7.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
$Groupbox6.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox6.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
$Groupbox8.Font = New-Object System.Drawing.Font('Calibri',10)
$Groupbox8.ForeColor =
[System.Drawing.ColorTranslator]::FromHtml("#4a90e2")
#Buttons
$btn_openreg.Flatstyle = 'Flat'
$btn_apply.Flatstyle = 'Flat'
$btn_applyglobal.Flatstyle = 'Flat'
$btn_applyadv.Flatstyle = 'Flat'
$btn_adaptrest.Flatstyle = 'Flat'
$btn_unqueues.Flatstyle = 'Flat'
#$btn_applotadapters.Flatstyle = 'Flat'
$btn_applypowersettings.Flatstyle = 'Flat'
$btn_applyall.Flatstyle = 'Flat'
$btn_applyInterfaceSettings.Flatstyle = 'Flat'
$btn_rssaddsupport.Flatstyle = 'Flat'
$btn_registrytweaksapply.Flatstyle = 'Flat'
$btn_Opacity.Flatstyle = 'Flat'
$btn_InterruptApply.Flatstyle = 'Flat'
#Locked Combos
$cb_AdapterNamesCombo.Flatstyle = 'Flat'
$cb_rss_onoff.Flatstyle = 'Flat'
$cb_rssprofile.Flatstyle = 'Flat'
$cb_rssbaseproc.Flatstyle = 'Flat'
$cb_rssmaxproc.Flatstyle = 'Flat'
$cb_rssmaxprocs.Flatstyle = 'Flat'
$cb_rssqueues.Flatstyle = 'Flat'
$cb_osrss.Flatstyle = 'Flat'
$cb_osrsc.Flatstyle = 'Flat'
$cb_oschimney.Flatstyle = 'Flat'
$cb_ostaskoff.Flatstyle = 'Flat'
$cb_osntd.Flatstyle = 'Flat'
$cb_osntdais.Flatstyle = 'Flat'
$cb_ospcf.Flatstyle = 'Flat'
$cb_flowcontrol.Flatstyle = 'Flat'
$cb_IPChecksumOffloadIPv4.Flatstyle = 'Flat'
$cb_TCPChecksumOffloadIPv4.Flatstyle = 'Flat'
$cb_TCPChecksumOffloadIPv6.Flatstyle = 'Flat'
$cb_UDPChecksumOffloadIPv4.Flatstyle = 'Flat'
$cb_UDPChecksumOffloadIPv6.Flatstyle = 'Flat'
$cb_InterruptModeration.Flatstyle = 'Flat'
$cb_LsoV1IPv4.Flatstyle = 'Flat'
$cb_LsoV2IPv4.Flatstyle = 'Flat'
$cb_LsoV2IPv6.Flatstyle = 'Flat'
$cb_PMARPOffload.Flatstyle = 'Flat'
$cb_PMNSOffload.Flatstyle = 'Flat'
$cb_PriorityVLANTag.Flatstyle = 'Flat'
$cb_ReceiveBuffers.Flatstyle = 'Flat'
$cb_TransmitBuffers.Flatstyle = 'Flat'
$cb_InterruptModerationRate.Flatstyle = 'Flat'
$cb_CoalesceBufferSize.Flatstyle = 'Flat'
$cb_rss_onoff.DropDownStyle = 'DropDownList'
$cb_AdapterNamesCombo.DropDownStyle = 'DropDownList'
$cb_rssprofile.DropDownStyle = 'DropDownList'
$cb_rssbaseproc.DropDownStyle = 'DropDownList'
$cb_rssmaxproc.DropDownStyle = 'DropDownList'
$cb_rssmaxprocs.DropDownStyle = 'DropDownList'
$cb_rssqueues.DropDownStyle = 'DropDownList'
$cb_osrss.DropDownStyle = 'DropDownList'
$cb_osrsc.DropDownStyle = 'DropDownList'
$cb_oschimney.DropDownStyle = 'DropDownList'
$cb_ostaskoff.DropDownStyle = 'DropDownList'
$cb_osntd.DropDownStyle = 'DropDownList'
$cb_osntdais.DropDownStyle = 'DropDownList'
$cb_ospcf.DropDownStyle = 'DropDownList'
$cb_flowcontrol.DropDownStyle = 'DropDownList'
$cb_IPChecksumOffloadIPv4.DropDownStyle = 'DropDownList'
$cb_TCPChecksumOffloadIPv4.DropDownStyle = 'DropDownList'
$cb_TCPChecksumOffloadIPv6.DropDownStyle = 'DropDownList'
$cb_UDPChecksumOffloadIPv4.DropDownStyle = 'DropDownList'
$cb_UDPChecksumOffloadIPv6.DropDownStyle = 'DropDownList'
$cb_InterruptModeration.DropDownStyle = 'DropDownList'
$cb_LsoV1IPv4.DropDownStyle = 'DropDownList'
$cb_LsoV2IPv4.DropDownStyle = 'DropDownList'
$cb_LsoV2IPv6.DropDownStyle = 'DropDownList'
$cb_PMARPOffload.DropDownStyle = 'DropDownList'
$cb_PMNSOffload.DropDownStyle = 'DropDownList'
$cb_PriorityVLANTag.DropDownStyle = 'DropDownList'
#$cb_CoalesceBufferSize.DropDownStyle = 'DropDownList'
$cb_Afd_defaultrecWin.Flatstyle = 'Flat'
$cb_Afd_defaultSendWin.Flatstyle = 'Flat'
$cb_BufferMultiplier.Flatstyle = 'Flat'
$cb_DisableAddressSharing.Flatstyle = 'Flat'
$cb_BufferAlignment.Flatstyle = 'Flat'
$cb_DoNotHoldNICBuffers.Flatstyle = 'Flat'
$cb_SmallBufferSize.Flatstyle = 'Flat'
$cb_MediumBufferSize.Flatstyle = 'Flat'
$cb_LargeBufferSize.Flatstyle = 'Flat'
$cb_HugeBufferSize.Flatstyle = 'Flat'
$cb_SmallBufferListDepth.Flatstyle = 'Flat'
$cb_MediumBufferListDepth.Flatstyle = 'Flat'
$cb_LargBufferListDepth.Flatstyle = 'Flat'
$cb_DisableChainedReceive.Flatstyle = 'Flat'
$cb_DisableDirectAcceptEx.Flatstyle = 'Flat'
$cb_DisableRawSecurity.Flatstyle = 'Flat'
$cb_DynamicSendBufferDisable.Flatstyle = 'Flat'
$cb_FastSendDatagramThreshold.Flatstyle = 'Flat'
$cb_FastCopyReceiveThreshold.Flatstyle = 'Flat'
$cb_IgnorePushBitOnReceives.Flatstyle = 'Flat'
$cb_IgnoreOrderlyRelease.Flatstyle = 'Flat'
$cb_TransmitWorker.Flatstyle = 'Flat'
$cb_PriorityBoost.Flatstyle = 'Flat'
$cb_DisablePortScaling.Flatstyle = 'Flat'
$cb_ManyCoreScaling.Flatstyle = 'Flat'
$cb_DisablePortScaling.DropDownStyle = 'DropDownList'
$cb_ManyCoreScaling.DropDownStyle = 'DropDownList'
$cb_PacketDirect.Flatstyle = 'Flat'
$cb_PacketDirect.DropDownStyle = 'DropDownList'
$cb_EnableCoalesce.Flatstyle = 'Flat'
$cb_EnableCoalesce.DropDownStyle = 'DropDownList'
$cb_EnableUdpTxScaling.Flatstyle = 'Flat'
$cb_EnableUdpTxScaling.DropDownStyle = 'DropDownList'
$cb_EnablePME.Flatstyle = 'Flat'
$cb_EnableDynamicPowerGating.Flatstyle = 'Flat'
$cb_EnableConnectedPowerGating.Flatstyle = 'Flat'
$cb_AutoPowerSaveModeEnabled.Flatstyle = 'Flat'
$cb_NicAutoPowerSaver.Flatstyle = 'Flat'
$cb_DisableDelayedPowerUp.Flatstyle = 'Flat'
$cb_ReduceSpeedOnPowerDown.Flatstyle = 'Flat'
$cb_EnablePME.DropDownStyle = 'DropDownList'
$cb_EnableDynamicPowerGating.DropDownStyle = 'DropDownList'
$cb_EnableConnectedPowerGating.DropDownStyle = 'DropDownList'
$cb_AutoPowerSaveModeEnabled.DropDownStyle = 'DropDownList'
$cb_NicAutoPowerSaver.DropDownStyle = 'DropDownList'
$cb_DisableDelayedPowerUp.DropDownStyle = 'DropDownList'
$cb_ReduceSpeedOnPowerDown.DropDownStyle = 'DropDownList'
$cb_DevicePolicy.Flatstyle = 'Flat'
$cb_MsiMode.Flatstyle = 'Flat'
$cb_InterruptPriority.Flatstyle = 'Flat'
$cb_MsiMode.DropDownStyle = 'DropDownList'
$cb_InterruptPriority.DropDownStyle = 'DropDownList'
$cb_DevicePolicy.DropDownStyle = 'DropDownList'
$cb_MsiMode.Enabled = $false
$cb_InterruptPriority.Enabled = $false
$lb_DevicePolicy.Enabled = $false
$cb_DevicePolicy.Enabled = $false
$btn_InterruptApply.Enabled = $false
$cb_AdvertiseDefaultRoute.Flatstyle = 'Flat'
$cb_Advertising.Flatstyle = 'Flat'
$cb_AutomaticMetric.Flatstyle = 'Flat'
$cb_ClampMss.Flatstyle = 'Flat'
$cb_DirectedMacWolPattern.Flatstyle = 'Flat'
$cb_EcnMarking.Flatstyle = 'Flat'
$cb_ForceArpNdWolPattern.Flatstyle = 'Flat'
$cb_Forwarding.Flatstyle = 'Flat'
$cb_IgnoreDefaultRoutes.Flatstyle = 'Flat'
$cb_ManagedAddressConfiguration.Flatstyle = 'Flat'
$cb_NeighborDiscoverySupported.Flatstyle = 'Flat'
$cb_NeighborUnreachabilityDetection.Flatstyle = 'Flat'
$cb_OtherStatefulConfiguration.Flatstyle = 'Flat'
$cb_RouterDiscovery.Flatstyle = 'Flat'
$cb_Store.Flatstyle = 'Flat'
$cb_WeakHostReceive.Flatstyle = 'Flat'
$cb_WeakHostSend.Flatstyle = 'Flat'
$cb_AdvertiseDefaultRoute.DropDownStyle = 'DropDownList'
$cb_Advertising.DropDownStyle = 'DropDownList'
$cb_AutomaticMetric.DropDownStyle = 'DropDownList'
$cb_ClampMss.DropDownStyle = 'DropDownList'
$cb_DirectedMacWolPattern.DropDownStyle = 'DropDownList'
$cb_EcnMarking.DropDownStyle = 'DropDownList'
$cb_ForceArpNdWolPattern.DropDownStyle = 'DropDownList'
$cb_Forwarding.DropDownStyle = 'DropDownList'
$cb_IgnoreDefaultRoutes.DropDownStyle = 'DropDownList'
$cb_ManagedAddressConfiguration.DropDownStyle = 'DropDownList'
$cb_NeighborDiscoverySupported.DropDownStyle = 'DropDownList'
$cb_NeighborUnreachabilityDetection.DropDownStyle = 'DropDownList'
$cb_OtherStatefulConfiguration.DropDownStyle = 'DropDownList'
$cb_RouterDiscovery.DropDownStyle = 'DropDownList'
$cb_Store.DropDownStyle = 'DropDownList'
$cb_WeakHostReceive.DropDownStyle = 'DropDownList'
$cb_WeakHostSend.DropDownStyle = 'DropDownList'
# ========================================================
# ========================================================
# RSS Global
$ErrorActionPreference = "SilentlyContinue"
$Global:TCPIP_RegPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
$Global:NDIS_RegPath = "HKLM:\SYSTEM\CurrentControlSet\Services\NDIS\Parameters"
# ========================================================
# Apply Button Global Settings
function applyglobal {
#cls
if ($cb_osrss.text -eq (Get-NetOffloadGlobalSetting | select -expand
ReceiveSideScaling))
{
#Write-Host " ReceiveSideScaling same as Current, skipping." -
ForegroundColor green
}
else
{
Write-Host "Applying ReceiveSideScaling to"$cb_osrss.text -ForegroundColor
Green
Set-NetOffloadGlobalSetting -ReceiveSideScaling $cb_osrss.text
$cb_osrss.text = (Get-NetOffloadGlobalSetting | select -expand
ReceiveSideScaling)
}
function Apply_NetworkDirect{
$NetworkDirectAvaible = ((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\
System\CurrentControlSet\Services\NDIS\Parameters").PSObject.Properties.Name -
contains "NetworkDirectDisable")
if ($NetworkDirectAvaible -eq $false -and $cb_osntd.Text -eq 'Disabled' ){
#Write-Host "Creating NetworkDirect DWORD with Value $
($cb_osntd.Text)." -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\NDIS\Parameters" -Name "NetworkDirectDisable" -Typ
"Dword" -Value "1"
}else{
#Write-Host "Removing NetworkDirect DWORD"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\NDIS\Parameters" -Name "NetworkDirectDisable"
}
}
function Apply_NetworkDirectGlobalFlags{
$NetworkDirectGlobalFlags = ((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\
System\CurrentControlSet\Services\NDIS\Parameters").PSObject.Properties.Name -
contains "NetworkDirectGlobalFlags")
if ($NetworkDirectGlobalFlags -eq $false -and $cb_osntdais.Text -eq 'Allowed'
){
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\NDIS\Parameters" -Name "NetworkDirectGlobalFlags" -Typ
"Dword" -Value "1"
}else{
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\NDIS\Parameters" -Name "NetworkDirectGlobalFlags"
}
}
#Adapter Selection
$AdapterName = Get-NetAdapter -physical | where status -eq 'up' | Select -expand
InterfaceDescription
#$AdapterName = Get-NetAdapter -IncludeHidden | Select -expand InterfaceDescription
#if($AdapterName )
@($AdapterName) | ForEach-Object {[void] $cb_AdapterNamesCombo.Items.Add($_)}
function a {
cls
Write-Host $cb_AdapterNamesCombo.Text
$Global:NIC_Desc = $cb_AdapterNamesCombo.Text
$lbl_ndisver.Text = Get-NetAdapter -InterfaceDescription $AdapterName | Select
-expand NdisVersion
$PhysicalAdapter = Get-WmiObject -Class Win32_NetworkAdapter|Where-
Object{$_.Name -like "$NIC_Desc"}
$PhysicalAdapterName = $PhysicalAdapter.Name
$DeviceID = $PhysicalAdapter.DeviceID
If([Int32]$DeviceID -lt 10)
{
$AdapterDeviceNumber = "000"+$DeviceID
}
Else
{
$AdapterDeviceNumber = "00"+$DeviceID
}
$Global:KeyPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\
{4D36E972-E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber"
If(Test-Path -Path $KeyPath)
{
Write-Host "Path found at ($KeyPath)."
$lbl_Path.Text = $KeyPath
}
Else
{
Write-Warning "The path ($KeyPath) not found."
}
#RSS Enabled or Not
$Global:rssstatus = (Get-NetAdapterRss).Enabled
if($rssstatus -eq 'True')
{
$cb_rss_onoff.Text = "Enable"
}
else
{
$cb_rss_onoff.Text = "Disable"
}
if($rssstatus -eq $Null )
{
Write-Warning "RSS is handled by OS, because of Network
Driver!"
$btn_rssaddsupport.Enabled = $true
#$cb_rssqueues.Enabled = $False
#$cb_rssprofile.Enabled = $False
#$cb_rssbaseproc.Enabled = $False
#$cb_rssmaxproc.Enabled = $False
#$cb_rssmaxprocs.Enabled = $False
}
else
{
$cb_rssqueues.Enabled = $true
$cb_rssprofile.Enabled = $true
$cb_rssbaseproc.Enabled = $true
$cb_rssmaxproc.Enabled = $true
$cb_rssmaxprocs.Enabled = $true
$btn_rssaddsupport.Enabled = $false
}
if($cb_rss_onoff.Text -eq 'Enable')
{
$Global:Rssstatusset = ($True)
}
else
{
$Global:Rssstatusset = ($False)
}
#IPv6 Disabled?
$IPv6_1 = (Get-ItemPropertyValue -Path "REGISTRY::HKEY_LOCAL_MACHINE\
SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" -Name "DisabledComponents")
$IPv6_2 = (Get-ItemPropertyValue -Path "REGISTRY::HKEY_LOCAL_MACHINE\
SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" -Name "EnableICSIPv6")
#RSS Queues
#Query Available RSSQueues
$AdapterQueuesRegTest = (Test-Path -Path "$KeyPath\Ndi\Params\
*NumRssQueues\Enum")
if($rssstatus -eq $null -Or $cb_rssqueues.Items.Count -eq '0' -and
$AdapterQueuesRegTest -eq $false){
#Write-Host "Powershell"
$Global:AdapterQueues = Get-NetAdapterRss -InterfaceDescription
$NIC_Desc | select -expand NumberOfReceiveQueues
$cb_rssqueues.Items.Add($AdapterQueues)
$cb_rssqueues.Text = $AdapterQueues
}else{
#Write-Host "Registry"
$AdapterQueues = Get-Item -Path "$KeyPath\Ndi\Params\*NumRssQueues\
Enum" | Select -ExpandProperty Property
@($AdapterQueues) | ForEach-Object {[void] $cb_rssqueues.Items.Add($_)}
$AdapterQueues = Get-ItemProperty -Path "$KeyPath\Ndi\Params\
*NumRssQueues" -Name "Default" | Select -expand Default
$cb_rssqueues.Text = $AdapterQueues
}
#RSS Profiles
$OSRSSProfiles =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetAdapterRss.Profile].GetEnumVa
lues()
@($OSRSSProfiles) | ForEach-Object {[void] $cb_rssprofile.Items.Add($_)}
$cb_rssprofile.Text = Get-NetAdapterRss | Select -ExpandProperty Profile
#RSS BaseProc
$cb_rssbaseproc.Text = Get-NetAdapterRss | Select -ExpandProperty
"BaseProcessorNumber"
$cb_rssmaxproc.Text = Get-NetAdapterRss | Select -ExpandProperty
"MaxProcessorNumber"
$cb_rssmaxprocs.Text = Get-NetAdapterRss | Select -ExpandProperty
"MaxProcessors"
#EnablePME
$EnablePME = (Get-ItemPropertyValue -Path "$KeyPath" -Name "EnablePME")
if ($EnablePME -eq '0' -or $EnablePME -eq '1' ){
$cb_EnablePME.SelectedIndex=$EnablePME
}else{
$cb_EnablePME.Items.Add('Undeclared')
$cb_EnablePME.Text = 'Undeclared'
}
#EnableDynamicPowerGating
$EnableDynamicPowerGating = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"*EnableDynamicPowerGating")
if ($EnableDynamicPowerGating -eq 0 -or $EnableDynamicPowerGating -eq 1
){
$cb_EnableDynamicPowerGating.SelectedIndex=$EnableDynamicPowerGating
}else{
$cb_EnableDynamicPowerGating.Items.Add('Undeclared')
$cb_EnableDynamicPowerGating.Text = 'Undeclared'
}
#EnableConnectedPowerGating
$EnableConnectedPowerGating = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"EnableConnectedPowerGating")
if ($EnableConnectedPowerGating -eq 0 -or $EnableConnectedPowerGating -
eq 1 ){
$cb_EnableConnectedPowerGating.SelectedIndex=$EnableConnectedPowerGating
}else{
$cb_EnableConnectedPowerGating.Items.Add('Undeclared')
$cb_EnableConnectedPowerGating.Text = 'Undeclared'
}
#AutoPowerSaveModeEnabled
$AutoPowerSaveModeEnabled = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"AutoPowerSaveModeEnabled")
if ($AutoPowerSaveModeEnabled -eq 0 -or $AutoPowerSaveModeEnabled -eq 1
){
$cb_AutoPowerSaveModeEnabled.SelectedIndex=$AutoPowerSaveModeEnabled
}else{
$cb_AutoPowerSaveModeEnabled.Items.Add('Undeclared')
$cb_EnableConnectedPowerGating.Text = 'Enabled'
}
#NicAutoPowerSaver
$NicAutoPowerSaver = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"*NicAutoPowerSaver")
if ($NicAutoPowerSaver -eq 0 -or $NicAutoPowerSaver -eq 1 ){
$cb_NicAutoPowerSaver.SelectedIndex=$NicAutoPowerSaver
}else{
$cb_NicAutoPowerSaver.Items.Add('Undeclared')
$cb_NicAutoPowerSaver.Text = 'Undeclared'
}
#DisableDelayedPowerUp
$DisableDelayedPowerUp = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"DisableDelayedPowerUp")
if ($DisableDelayedPowerUp -eq 0 -or $DisableDelayedPowerUp -eq 1 ){
$cb_DisableDelayedPowerUp.SelectedIndex=$DisableDelayedPowerUp
}else{
$cb_DisableDelayedPowerUp.Items.Add('Undeclared')
$cb_DisableDelayedPowerUp.Text = 'Undeclared'
}
#ReduceSpeedOnPowerDown
$ReduceSpeedOnPowerDown = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"ReduceSpeedOnPowerDown")
if ($ReduceSpeedOnPowerDown -eq 0 -or $ReduceSpeedOnPowerDown -eq 1 ){
$cb_ReduceSpeedOnPowerDown.SelectedIndex=$ReduceSpeedOnPowerDown
}else{
$cb_ReduceSpeedOnPowerDown.Items.Add('Undeclared')
$cb_ReduceSpeedOnPowerDown.Text = 'Undeclared'
}
#DisablePortScaling
$DisablePortScaling = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"DisablePortScaling")
if ($DisablePortScaling -eq 0 -or $DisablePortScaling -eq 1 ){
$cb_DisablePortScaling.SelectedIndex=$DisablePortScaling
}else{
$cb_DisablePortScaling.Items.Add('Undeclared')
$cb_DisablePortScaling.Text = 'Undeclared'
}
#ManyCoreScaling
$ManyCoreScaling = (Get-ItemPropertyValue -Path "$KeyPath" -Name
"ManyCoreScaling")
if ($ManyCoreScaling -eq 0 -or $ManyCoreScaling -eq 1 ){
$cb_ManyCoreScaling.SelectedIndex=$ManyCoreScaling
}else{
$cb_ManyCoreScaling.Items.Add('Undeclared')
$cb_ManyCoreScaling.Text = 'Undeclared'
}
#AFDDefaultReceiveWindow
$AFDDefaultReceiveWindow = (Get-ItemPropertyValue -Path
"REGISTRY::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\AFD\Parameters" -
Name "DefaultReceiveWindow")
$cb_Afd_defaultRecWin.Text=$AFDDefaultReceiveWindow
#AFDDefaultSendWindow
$AFDDefaultSendWindow = (Get-ItemPropertyValue -Path
"REGISTRY::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\AFD\Parameters" -
Name "DefaultSendWindow")
$cb_Afd_defaultSendWin.Text=$AFDDefaultSendWindow
#BufferMultiplier
$AFDBufferMultiplier = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferMultiplier")
$cb_BufferMultiplier.Text=$AFDBufferMultiplier
#DisableAddressSharing
$AFDDisableAddressSharing = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "DisableAddressSharing")
$cb_DisableAddressSharing.Text=$AFDDisableAddressSharing
#BufferAlignment
$AFDBufferAlignment = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferAlignment")
$cb_BufferAlignment.Text=$AFDBufferAlignment
#DoNotHoldNICBuffers
$AFDDoNotHoldNICBuffers = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "DoNotHoldNICBuffers")
$cb_DoNotHoldNICBuffers.Text=$AFDDoNotHoldNICBuffers
#SmallBufferSize
$AFDSmallBufferSize = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferSize")
$cb_SmallBufferSize.Text=$AFDSmallBufferSize
#MediumBufferSize
$AFDMediumBufferSize = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferSize")
$cb_MediumBufferSize.Text=$AFDMediumBufferSize
#LargeBufferSize
$AFDLargeBufferSize = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "LargeBufferSize")
$cb_LargeBufferSize.Text=$AFDLargeBufferSize
#HugeBufferSize
$AFDHugeBufferSize = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "HugeBufferSize")
$cb_HugeBufferSize.Text=$AFDHugeBufferSize
#SmallBufferListDepth
$AFDSmallBufferListDepth = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferListDepth")
$cb_SmallBufferListDepth.Text=$AFDSmallBufferListDepth
#MediumBufferListDepth
$AFDMediumBufferListDepth = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferListDepth")
$cb_MediumBufferListDepth.Text=$AFDMediumBufferListDepth
#LargBufferListDepth
$AFDLargBufferListDepth = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "LargBufferListDepth")
$cb_LargBufferListDepth.Text=$AFDLargBufferListDepth
#DisableChainedReceive
$AFDDisableChainedReceive = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "DisableChainedReceive")
$cb_DisableChainedReceive.Text=$AFDDisableChainedReceive
#DisableDirectAcceptEx
$AFDDisableDirectAcceptEx = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "DisableDirectAcceptEx")
$cb_DisableDirectAcceptEx.Text=$AFDDisableDirectAcceptEx
#DisableRawSecurity
$AFDDisableRawSecurity = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "DisableRawSecurity")
$cb_DisableRawSecurity.Text=$AFDDisableRawSecurity
#DynamicSendBufferDisable
$AFDDynamicSendBufferDisable = (Get-ItemPropertyValue -Path
"REGISTRY::HKLM\System\CurrentControlSet\Services\AFD\Parameters" -Name
"DynamicSendBufferDisable")
$cb_DynamicSendBufferDisable.Text=$AFDDynamicSendBufferDisable
#FastSendDatagramThreshold
$AFDFastSendDatagramThreshold = (Get-ItemPropertyValue -Path
"REGISTRY::HKLM\System\CurrentControlSet\Services\AFD\Parameters" -Name
"FastSendDatagramThreshold")
$cb_FastSendDatagramThreshold.Text=$AFDFastSendDatagramThreshold
#FastCopyReceiveThreshold
$AFDFastCopyReceiveThreshold = (Get-ItemPropertyValue -Path
"REGISTRY::HKLM\System\CurrentControlSet\Services\AFD\Parameters" -Name
"FastCopyReceiveThreshold")
$cb_FastCopyReceiveThreshold.Text=$AFDFastCopyReceiveThreshold
#IgnorePushBitOnReceives
$AFDIgnorePushBitOnReceives = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "IgnorePushBitOnReceives")
$cb_IgnorePushBitOnReceives.Text=$AFDIgnorePushBitOnReceives
#IgnoreOrderlyRelease
$AFDIgnoreOrderlyRelease = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\
System\CurrentControlSet\Services\AFD\Parameters" -Name "IgnoreOrderlyRelease")
$cb_IgnoreOrderlyRelease.Text=$AFDIgnoreOrderlyRelease
#TransmitWorker
$AFDTransmitWorker = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "TransmitWorker")
$cb_TransmitWorker.Text=$AFDTransmitWorker
#PriorityBoost
$AFDPriorityBoost = (Get-ItemPropertyValue -Path "REGISTRY::HKLM\System\
CurrentControlSet\Services\AFD\Parameters" -Name "PriorityBoost")
$cb_PriorityBoost.Text=$AFDPriorityBoost
#NetIPInterface
#NetIPInterface
#AdvertiseDefaultRoute
$AdvertiseDefaultRoute =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.AdvertiseDefaultR
oute].GetEnumValues()
@($AdvertiseDefaultRoute) | ForEach-Object {[void]
$cb_AdvertiseDefaultRoute.Items.Add($_)}
$cb_AdvertiseDefaultRoute.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
AdvertiseDefaultRoute
#Advertising
$Advertising =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.Advertising].GetE
numValues()
@($Advertising) | ForEach-Object {[void] $cb_Advertising.Items.Add($_)}
$cb_Advertising.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand Advertising
#AutomaticMetric
$AutomaticMetric =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.AutomaticMetric].
GetEnumValues()
@($AutomaticMetric) | ForEach-Object {[void]
$cb_AutomaticMetric.Items.Add($_)}
$cb_AutomaticMetric.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
AutomaticMetric
#ClampMss
$ClampMss =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.ClampMss].GetEnum
Values()
@($ClampMss) | ForEach-Object {[void] $cb_ClampMss.Items.Add($_)}
$cb_ClampMss.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand ClampMss
#DirectedMacWolPattern
$DirectedMacWolPattern =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.DirectedMacWolPat
tern].GetEnumValues()
@($DirectedMacWolPattern) | ForEach-Object {[void]
$cb_DirectedMacWolPattern.Items.Add($_)}
$cb_DirectedMacWolPattern.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
DirectedMacWolPattern
#EcnMarking
$EcnMarking =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.EcnMarking].GetEn
umValues()
@($EcnMarking) | ForEach-Object {[void] $cb_EcnMarking.Items.Add($_)}
$cb_EcnMarking.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand EcnMarking
#ForceArpNdWolPattern
$ForceArpNdWolPattern =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.ForceArpNdWolPatt
ern].GetEnumValues()
@($ForceArpNdWolPattern) | ForEach-Object {[void]
$cb_ForceArpNdWolPattern.Items.Add($_)}
$cb_ForceArpNdWolPattern.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ForceArpNdWolPattern
#Forwarding
$Forwarding =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.Forwarding].GetEn
umValues()
@($Forwarding) | ForEach-Object {[void] $cb_Forwarding.Items.Add($_)}
$cb_Forwarding.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand Forwarding
#IgnoreDefaultRoutes
$IgnoreDefaultRoutes =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.IgnoreDefaultRout
es].GetEnumValues()
@($IgnoreDefaultRoutes) | ForEach-Object {[void]
$cb_IgnoreDefaultRoutes.Items.Add($_)}
$cb_IgnoreDefaultRoutes.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
IgnoreDefaultRoutes
#ManagedAddressConfiguration
$ManagedAddressConfiguration =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.ManagedAddressCon
figuration].GetEnumValues()
@($ManagedAddressConfiguration) | ForEach-Object {[void]
$cb_ManagedAddressConfiguration.Items.Add($_)}
$cb_ManagedAddressConfiguration.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ManagedAddressConfiguration
#NeighborDiscoverySupported
$NeighborDiscoverySupported =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.NeighborDiscovery
Supported].GetEnumValues()
@($NeighborDiscoverySupported) | ForEach-Object {[void]
$cb_NeighborDiscoverySupported.Items.Add($_)}
$cb_NeighborDiscoverySupported.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
NeighborDiscoverySupported
#NeighborUnreachabilityDetection
$NeighborUnreachabilityDetection =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.NeighborUnreachab
ilityDetection].GetEnumValues()
@($NeighborUnreachabilityDetection) | ForEach-Object {[void]
$cb_NeighborUnreachabilityDetection.Items.Add($_)}
$cb_NeighborUnreachabilityDetection.Text = Get-NetIPInterface -
InterfaceAlias $NetConnectionID -AddressFamily $Global:AddressFamily | Select-
Object -Expand NeighborUnreachabilityDetection
#OtherStatefulConfiguration
$OtherStatefulConfiguration =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.OtherStatefulConf
iguration].GetEnumValues()
@($OtherStatefulConfiguration) | ForEach-Object {[void]
$cb_OtherStatefulConfiguration.Items.Add($_)}
$cb_OtherStatefulConfiguration.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
OtherStatefulConfiguration
#RouterDiscovery
$RouterDiscovery =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.RouterDiscovery].
GetEnumValues()
@($RouterDiscovery) | ForEach-Object {[void]
$cb_RouterDiscovery.Items.Add($_)}
$cb_RouterDiscovery.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
RouterDiscovery
#Store
$Store =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.Store].GetEnumVal
ues()
@($Store) | ForEach-Object {[void] $cb_Store.Items.Add($_)}
$cb_Store.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand Store
#WeakHostReceive
$WeakHostReceive =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.WeakHostReceive].
GetEnumValues()
@($WeakHostReceive) | ForEach-Object {[void]
$cb_WeakHostReceive.Items.Add($_)}
$cb_WeakHostReceive.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
WeakHostReceive
#WeakHostSend
$WeakHostSend =
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPInterface.WeakHostSend].Get
EnumValues()
@($WeakHostSend) | ForEach-Object {[void] $cb_WeakHostSend.Items.Add($_)}
$cb_WeakHostSend.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
WeakHostSend
#CurrentHopLimit
#When this parameter value is set to 0, it uses this default.
$tb_CurrentHopLimit.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
CurrentHopLimit
#BaseReachableTime
#Specifies the base value for random reachable time, in milliseconds. For
more information, see RFC 2461.
#The default value is 30000.
$tb_BaseReachableTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
BaseReachableTime
#ReachableTime
#Specifies an array of reachable time values. This parameter is the time,
in milliseconds, that a node assumes that a neighbor
#is reachable after having received a reachability confirmation. This
parameter works with the NeighborUnreachabilityDetection parameter.
$tb_ReachableTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ReachableTime
#DadRetransmitTime
#Specifies a value for the time interval between neighbor solicitation
messages.
$tb_DadRetransmitTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
DadRetransmitTime
#DadTransmits
#Specifies a value for the number of consecutive messages sent while the
network driver performs duplicate address detection.
$tb_DadTransmits.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand DadTransmits
#NlMtu
#Specifies the network layer Maximum Transmission Unit (MTU) value, in
bytes, for an IP interface.
#For IPv4 the minimum value is 576 bytes. For IPv6 the minimum is value is
1280 bytes.
#For both IPv4 and IPv6, the maximum value is 2^32-1 (4294967295). You
cannot set values outside these ranges.
#If this parameter is set to 0, then it will remain unchanged and maintain
its current value. The IP interface will not transmit packets larger than the
maximum value.
$tb_NlMtu.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand NlMtu
#RetransmitTime (RetransmitTimeMs)
#Specifies a value for timeout and retransmission, in milliseconds, for
Neighbor Solicitation messages.
#For more information, see RetransTimer in RFC 2461.
#By default, the value is set to 1000.
$tb_RetransmitTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
RetransmitTime
$PathInterrupt = 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Enum'
#$Global:EthernetClassGuid
#$Global:EthernetPNPDeviceID
$Global:NewPathInterrupt = "$PathInterrupt\$EthernetPNPDeviceID"
$Test = Test-Path REGISTRY::$NewPathInterrupt
if ($Test){
$cb_MsiMode.Enabled = $True
$cb_InterruptPriority.Enabled = $True
$lb_MsiMode.Enabled = $True
$lb_InterruptPriority.Enabled = $True
$lb_DevicePolicy.Enabled = $True
$cb_DevicePolicy.Enabled = $True
$btn_InterruptApply.Enabled = $True
$MsiModeRegistry = Get-ItemPropertyValue -Path "REGISTRY::
$NewPathInterrupt\Device Parameters\Interrupt Management\
MessageSignaledInterruptProperties" -Name "MSISupported"
if($MsiModeRegistry -eq "1"){
$cb_MsiMode.Text = "Enabled"}
if($MsiModeRegistry -eq "0"){
$cb_MsiMode.Text = "Disabled"}
#AddRSSSupport
function RSSEnable{
Write-Host "Enabling RSS Support for "$PhysicalAdapter.Name
New-Item "$KeyPath\Ndi\Params\*RSS" -Force
function applyadvsettings {
#cls
#FlowControl
if ($cb_flowcontrol.SelectedIndex -eq (Get-ItemPropertyValue -Path
"$KeyPath" -Name "*FlowControl")){
Write-Host "FlowControl is same then Registry, skipping." -
ForegroundColor green}
#IPChecksumOffloadIPv4
if ($cb_IPChecksumOffloadIPv4.SelectedIndex -eq (Get-ItemPropertyValue -
Path "$KeyPath" -Name "*IPChecksumOffloadIPv4")){
Write-Host "IPChecksumOffloadIPv4 is same then Registry, skipping." -
ForegroundColor green}
#TCPChecksumOffloadIPv4
if ($cb_TCPChecksumOffloadIPv4.SelectedIndex -eq (Get-ItemPropertyValue -
Path "$KeyPath" -Name "*TCPChecksumOffloadIPv4")){
Write-Host "TCPChecksumOffloadIPv4 is same then Registry, skipping." -
ForegroundColor green}
#TCPChecksumOffloadIPv6
if ($cb_TCPChecksumOffloadIPv6.SelectedIndex -eq (Get-ItemPropertyValue -
Path "$KeyPath" -Name "*TCPChecksumOffloadIPv6")){
Write-Host "TCPChecksumOffloadIPv6 is same then Registry, skipping." -
ForegroundColor green}
#UDPChecksumOffloadIPv4
if ($cb_UDPChecksumOffloadIPv4.SelectedIndex -eq (Get-ItemPropertyValue -
Path "$KeyPath" -Name "*UDPChecksumOffloadIPv4")){
Write-Host "UDPChecksumOffloadIPv4 is same then Registry, skipping." -
ForegroundColor Green}
#UDPChecksumOffloadIPv6
if ($cb_UDPChecksumOffloadIPv6.SelectedIndex -eq (Get-ItemPropertyValue -
Path "$KeyPath" -Name "*UDPChecksumOffloadIPv6")){
Write-Host "UDPChecksumOffloadIPv6 is same then Registry, skipping." -
ForegroundColor Green}
#Large-Send-Offload V2 (IPv4)
if ($cb_LsoV2IPv4.SelectedIndex -eq (Get-ItemPropertyValue -Path "$KeyPath"
-Name "*LsoV2IPv4")){
Write-Host "LsoV2IPv4 is same then Registry, skipping." -
ForegroundColor green}
#Large-Send-Offload V2 (IPv6)
if ($cb_LsoV2IPv6.SelectedIndex -eq (Get-ItemPropertyValue -Path "$KeyPath"
-Name "*LsoV2IPv6")){
Write-Host "LsoV2IPv6 is same then Registry, skipping." -
ForegroundColor green}
elseif ($cb_LsoV2IPv6.SelectedIndex -eq '0'){
Write-Host "Disabling LsoV2IPv4" -ForegroundColor Green
Set-ItemProperty -Path "$KeyPath" -Name "*LsoV2IPv6" -Value "0" -Force}
#Large-Send-Offload V1 (IPv4)
if ($cb_LsoV1IPv4.SelectedIndex -eq (Get-ItemPropertyValue -Path "$KeyPath"
-Name "*LsoV1IPv4")){
Write-Host "LsoV1IPv4 is same then Registry, skipping." -
ForegroundColor green}
#PMARPOffload
if ($cb_PMARPOffload.SelectedIndex -eq (Get-ItemPropertyValue -Path
"$KeyPath" -Name "*PMARPOffload")){
Write-Host "PMARPOffload is same then Registry, skipping." -
ForegroundColor green}
#PMNSOffload
if ($cb_PMNSOffload.SelectedIndex -eq (Get-ItemPropertyValue -Path
"$KeyPath" -Name "*PMNSOffload")){
Write-Host "PMNSOffload is same then Registry, skipping." -
ForegroundColor green}
#PriorityVLANTag
if ($cb_PriorityVLANTag.SelectedIndex -eq (Get-ItemPropertyValue -Path
"$KeyPath" -Name "*PriorityVLANTag")){
Write-Host "PriorityVLANTag is same then Registry, skipping." -
ForegroundColor Green}
#ReceiveBuffers
if ($cb_ReceiveBuffers.Text -eq (Get-ItemPropertyValue -Path "$KeyPath" -
Name "*ReceiveBuffers"))
{
Write-Host "ReceiveBuffers is same then Registry, skipping." -
ForegroundColor Green
}
else
{
Write-Host "Set ReceiveBuffers to $($cb_ReceiveBuffers.Text)" -
ForegroundColor Green
Set-ItemProperty -Path "$KeyPath" -Name "*ReceiveBuffers" -Value "$
($cb_ReceiveBuffers.Text)" -Force
}
#TransmitBuffers
if ($cb_TransmitBuffers.Text -eq (Get-ItemPropertyValue -Path "$KeyPath" -
Name "*TransmitBuffers"))
{
Write-Host "TransmitBuffers is same then Registry, skipping." -
ForegroundColor Green
}
else
{
Write-Host "Set TransmitBuffers to $($cb_TransmitBuffers.Text)" -
ForegroundColor Green
Set-ItemProperty -Path "$KeyPath" -Name "*TransmitBuffers" -Value "$
($cb_TransmitBuffers.Text)" -Force
}
#InterruptModeration
if ($cb_InterruptModeration.SelectedIndex -eq (Get-ItemPropertyValue -Path
"$KeyPath" -Name "*InterruptModeration")){
Write-Host "InterruptModeration is same then Registry, skipping." -
ForegroundColor Green}
#InterruptModerationRate
#$RegITR = (Get-ItemPropertyValue -Path "$KeyPath" -Name "ITR")
#if ($cb_InterruptModerationRate.Text -eq $RegITR -xor
$cb_InterruptModerationRate.SelectedIndex >0){
#Write-Host "InterruptModerationRate is same then Registry, skipping."
-ForegroundColor green}
#TxIntDelay
#I-219V 28TxDelay Default
if ($tb_TxIntDelay.Text -eq (Get-ItemPropertyValue -Path "$KeyPath" -
Name "TxIntDelay"))
{
Write-Host "TxIntDelay is same then Registry, skipping." -
ForegroundColor Green
}
else
{
Write-Host "Set TxIntDelay to"$tb_TxIntDelay.Text -ForegroundColor
Green
Set-ItemProperty -Path "$KeyPath" -Name "TxIntDelay" -Value
$tb_TxIntDelay.Text -Force
}
#PacketDirect
#Unsure Default Enabled or Disabled
#Ref:https://docs.microsoft.com/en-us/windows-hardware/drivers/network/
introduction-to-ndis-pdpi
if ($cb_PacketDirect.Text -match 'Undefined'){
#Write-Host "PacketDirect to"$cb_PacketDirect.Text -
ForegroundColor Green
Remove-ItemProperty -Path "$KeyPath" -Name "*PacketDirect" -Force}
#EnableCoalesce
if ($cb_EnableCoalesce.Text -match 'Undefined'){
#Write-Host "EnableCoalesce to"$cb_EnableCoalesce.Text -
ForegroundColor Green
Remove-ItemProperty -Path "$KeyPath" -Name "EnableCoalesce" -Force}
#CoalesceBufferSize
$A=((Get-ItemProperty -Path "$KeyPath").PSObject.Properties.Name -
contains "CoalesceBufferSize")
if ($A -eq $false -and $cb_CoalesceBufferSize.Text -ne $null -and
$cb_CoalesceBufferSize.Text -ne '2048' ){
Write-Host "Set CoalesceBufferSize
to"$cb_CoalesceBufferSize.Text -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "CoalesceBufferSize" -Typ
"Dword" -Value $cb_CoalesceBufferSize.Text -Force
}elseif($A -eq $true -and $cb_CoalesceBufferSize.Text -eq $null -or
$cb_CoalesceBufferSize.Text -eq ''){
Write-Warning "Removing CoalesceBufferSize"
Remove-ItemProperty -Path "$KeyPath" -Name
"CoalesceBufferSize"
}else{
Write-Host "Set CoalesceBufferSize
to"$cb_CoalesceBufferSize.Text -ForegroundColor Green
Set-ItemProperty -Path "$KeyPath" -Name "CoalesceBufferSize" -
Value $cb_CoalesceBufferSize.Text -Force
}
#EnableUdpTxScaling
if ($cb_EnableUdpTxScaling.Text -match 'Undefined'){
#Write-Host "EnableUdpTxScaling to"$cb_EnableUdpTxScaling.Text -
ForegroundColor Green
Remove-ItemProperty -Path "$KeyPath" -Name "EnableUdpTxScaling" -
Force}
if ($cb_EnableUdpTxScaling.Text -match 'Enabled'){
Write-Host "EnableUdpTxScaling to"$cb_EnableUdpTxScaling.Text -
ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "EnableUdpTxScaling" -Value
"1" -PropertyType "DWORD" -Force}
if ($cb_EnableUdpTxScaling.Text -match 'Disabled'){
Write-Host "EnableUdpTxScaling to"$cb_EnableUdpTxScaling.Text -
ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "EnableUdpTxScaling" -Value
"0" -PropertyType "DWORD" -Force}
function applypowersavingsettings {
#cls
# ========================================================
# PowerSettings
#EnablePME
# Enables/disables wake-up from Advanced Power Management (APM) sleep
states.
if ($cb_EnablePME.SelectedIndex -eq '0'){
Write-Host "Disabling (APM) sleep states" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "EnablePME" -PropertyType DWORD
-Value "0" -Force}
if ($cb_EnablePME.SelectedIndex -eq '1'){
Write-Host "Enabling (APM) sleep states" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "EnablePME" -PropertyType DWORD
-Value "1" -Force}
if ($cb_EnablePME.SelectedIndex -eq '2'){
Write-Host "Skipping (APM) sleep states" -ForegroundColor Green}
#EnableDynamicPowerGating
if ($cb_EnableDynamicPowerGating.SelectedIndex -eq '0'){
Write-Host "Disabling DynamicPowerGating" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "*EnableDynamicPowerGating" -
PropertyType String -Value "0" -Force}
if ($cb_EnableDynamicPowerGating.SelectedIndex -eq '1'){
Write-Host "Enabling DynamicPowerGating" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "*EnableDynamicPowerGating" -
PropertyType String -Value "1" -Force}
if ($cb_EnableDynamicPowerGating.SelectedIndex -eq '2'){
Write-Host "Skipping DynamicPowerGating" -ForegroundColor Green}
#EnableConnectedPowerGating
if ($cb_EnableConnectedPowerGating.SelectedIndex -eq '0'){
Write-Host "Disabling ConnectedPowerGating" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "EnableConnectedPowerGating" -
PropertyType DWORD -Value "0" -Force}
if ($cb_EnableConnectedPowerGating.SelectedIndex -eq '1'){
Write-Host "Enabling ConnectedPowerGating" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "EnableConnectedPowerGating" -
PropertyType DWORD -Value "1" -Force}
if ($cb_EnableConnectedPowerGating.SelectedIndex -eq '2'){
Write-Host "Skipping ConnectedPowerGating" -ForegroundColor Green}
#AutoPowerSaveModeEnabled
if ($cb_AutoPowerSaveModeEnabled.SelectedIndex -eq '0'){
Write-Host "Disabling AutoPowerSaveMode" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "AutoPowerSaveModeEnabled" -
PropertyType DWORD -Value "0" -Force}
if ($cb_AutoPowerSaveModeEnabled.SelectedIndex -eq '1'){
Write-Host "Enabling AutoPowerSaveMode" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "AutoPowerSaveModeEnabled" -
PropertyType DWORD -Value "1" -Force}
if ($cb_AutoPowerSaveModeEnabled.SelectedIndex -eq '2'){
Write-Host "Skipping AutoPowerSaveMode" -ForegroundColor Green}
#NicAutoPowerSaver
if ($cb_NicAutoPowerSaver.SelectedIndex -eq '0'){
Write-Host "Disabling NicAutoPowerSaver" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "*NicAutoPowerSaver" -
PropertyType String -Value "0" -Force}
if ($cb_NicAutoPowerSaver.SelectedIndex -eq '1'){
Write-Host "Enabling NicAutoPowerSaver" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "*NicAutoPowerSaver" -
PropertyType String -Value "1" -Force}
if ($cb_NicAutoPowerSaver.SelectedIndex -eq '2'){
Write-Host "Skipping NicAutoPowerSaver" -ForegroundColor Green}
#DisableDelayedPowerUp
if ($cb_DisableDelayedPowerUp.SelectedIndex -eq '0'){
Write-Host "Enabling DelayedPowerUp" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "DisableDelayedPowerUp" -
PropertyType DWORD -Value "0" -Force}
if ($cb_DisableDelayedPowerUp.SelectedIndex -eq '1'){
Write-Host "Disabling DelayedPowerUp" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "DisableDelayedPowerUp" -
PropertyType DWORD -Value "1" -Force}
if ($cb_DisableDelayedPowerUp.SelectedIndex -eq '2'){
Write-Host "Skipping DelayedPowerUp" -ForegroundColor Green}
#ReduceSpeedOnPowerDown
if ($cb_ReduceSpeedOnPowerDown.SelectedIndex -eq '0'){
Write-Host "Disabling ReduceSpeedOnPowerDown" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "ReduceSpeedOnPowerDown" -
PropertyType DWORD -Value "0" -Force}
if ($cb_ReduceSpeedOnPowerDown.SelectedIndex -eq '1'){
Write-Host "Enabling ReduceSpeedOnPowerDown" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "ReduceSpeedOnPowerDown" -
PropertyType DWORD -Value "1" -Force}
if ($cb_ReduceSpeedOnPowerDown.SelectedIndex -eq '2'){
Write-Host "Skipping ReduceSpeedOnPowerDown" -ForegroundColor Green}
$cb_AdapterNamesCombo.Add_SelectedValueChanged({ a; NetIPInterface })
function adapter_restart {
Try {
Restart-NetAdapter -InterfaceDescription $NIC_Desc
Write-Host "Restarting Adapter $NIC_Desc now!" -ForegroundColor Red
}
catch{
Write-Host "No Adapter selected." -ForegroundColor Red
}
}
function btn_regopadap {
Try {
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Applets\
Regedit"
$name = "LastKey"
$value = "Computer\"+(Convert-Path ($Global:KeyPath))
New-ItemProperty -Path $regPath -Name $name -Value $value -
PropertyType String -Force | Out-Null
Start-Process RegEdit
}
catch
{
Write-Host "No Adapter selected." -ForegroundColor Red
}
}
function Interrupt{
$Path = 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Enum'
#$Global:EthernetClassGuid
#$Global:EthernetPNPDeviceID
$NewPath = "$Path\$EthernetPNPDeviceID"
$Test = Test-Path REGISTRY::$NewPath
if ($Test){
}else{
Write-Warning "GPU not found. Abort"
}
}
function bypassrssqueues{
$error.clear()
try { Set-NetAdapterRss -InterfaceDescription $($Global:NIC_Desc) -
BaseProcessorNumber $($cb_rssbaseproc.Text) -MaxProcessorNumber $
($cb_rssmaxproc.Text) -Profile $($cb_rssprofile.Text) -MaxProcessors $
($cb_rssmaxprocs.Text) -Enabled $($Global:Rssstatusset) -ErrorAction Stop
} catch { Write-Warning "Error occured while Setting Set-NetAdapterRss,
Abort." }
if (!$error) { Write-Host 'No Error Occured, while Setting Set-NetAdapterRss
without NumberOfReceiveQueues. Continue.'
Write-Host "Using Registry now, to set RSS Queues to $
($cb_rssqueues.Text)"
Set-ItemProperty -Path "$KeyPath\Ndi\Params\*NumRssQueues" -
Name "default" -Value $cb_rssqueues.Text -Force -ErrorAction "Stop"
Write-Host "Done."
}
}
function applyrsssettings {
#DisablePortScaling
if ($cb_DisablePortScaling.SelectedIndex -eq '0'){
Write-Host "Disabling DisablePortScaling" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "DisablePortScaling" -PropertyType
DWORD -Value "0" -Force}
if ($cb_DisablePortScaling.SelectedIndex -eq '1'){
Write-Host "Enabling DisablePortScaling" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "DisablePortScaling" -PropertyType
DWORD -Value "1" -Force}
if ($cb_DisablePortScaling.SelectedIndex -eq '2'){
Write-Host "Skipping DisablePortScaling" -ForegroundColor Green}
#ManyCoreScaling
if ($cb_ManyCoreScaling.SelectedIndex -eq '0'){
Write-Host "Disabling ManyCoreScaling" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "ManyCoreScaling" -PropertyType
DWORD -Value "0" -Force}
if ($cb_ManyCoreScaling.SelectedIndex -eq '1'){
Write-Host "Enabling ManyCoreScaling" -ForegroundColor Green
New-ItemProperty -Path "$KeyPath" -Name "ManyCoreScaling" -PropertyType
DWORD -Value "1" -Force}
if ($cb_ManyCoreScaling.SelectedIndex -eq '2'){
Write-Host "Skipping ManyCoreScaling" -ForegroundColor Green}
function ApplyInterfaceSettings{
if ($cb_AdvertiseDefaultRoute.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
AdvertiseDefaultRoute)){
Write-Host "AdvertiseDefaultRoute is same, skipping." -ForegroundColor
green}
else{
Write-Host "AdvertiseDefaultRoute:"$cb_AdvertiseDefaultRoute.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -AdvertiseDefaultRoute $cb_AdvertiseDefaultRoute.Text
}
if ($cb_Advertising.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
Advertising)){
Write-Host "Advertising is same, skipping." -ForegroundColor green}
else{
Write-Host "Advertising:"$cb_Advertising.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -Advertising $cb_Advertising.Text
}
if ($cb_AutomaticMetric.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
AutomaticMetric)){
Write-Host "AutomaticMetric is same, skipping." -ForegroundColor green}
else{
Write-Host "AutomaticMetric:"$cb_AutomaticMetric.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -AutomaticMetric $cb_AutomaticMetric.Text
}
if ($cb_ClampMss.Text -eq (Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand ClampMss)){
Write-Host "ClampMss is same, skipping." -ForegroundColor green}
else{
Write-Host "ClampMss:"$cb_ClampMss.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -ClampMss $cb_ClampMss.Text
}
if ($DirectedMacWolPattern.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
DirectedMacWolPattern)){
Write-Host "DirectedMacWolPattern is same, skipping." -ForegroundColor
green}
else{
Write-Host "DirectedMacWolPattern:"$DirectedMacWolPattern.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -DirectedMacWolPattern $DirectedMacWolPattern.Text
}
if ($cb_EcnMarking.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
EcnMarking)){
Write-Host "EcnMarking is same, skipping." -ForegroundColor green}
else{
Write-Host "EcnMarking:"$cb_EcnMarking.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -EcnMarking $cb_EcnMarking.Text
}
if ($cb_ForceArpNdWolPattern.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ForceArpNdWolPattern)){
Write-Host "ForceArpNdWolPattern is same, skipping." -ForegroundColor
green}
else{
Write-Host "ForceArpNdWolPattern:"$cb_ForceArpNdWolPattern.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -ForceArpNdWolPattern $cb_ForceArpNdWolPattern.Text
}
if ($cb_Forwarding.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
Forwarding)){
Write-Host "Forwarding is same, skipping." -ForegroundColor green}
else{
Write-Host "Forwarding:"$cb_Forwarding.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -Forwarding $cb_Forwarding.Text
}
if ($cb_IgnoreDefaultRoutes.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
IgnoreDefaultRoutes)){
Write-Host "IgnoreDefaultRoutes is same, skipping." -ForegroundColor
green}
else{
Write-Host "IgnoreDefaultRoutes:"$cb_IgnoreDefaultRoutes.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -IgnoreDefaultRoutes $cb_IgnoreDefaultRoutes.Text
}
if ($cb_ManagedAddressConfiguration.Text -eq (Get-NetIPInterface -
InterfaceAlias $NetConnectionID -AddressFamily $Global:AddressFamily | Select-
Object -Expand ManagedAddressConfiguration)){
Write-Host "ManagedAddressConfiguration is same, skipping." -
ForegroundColor green}
else{
Write-Host
"ManagedAddressConfiguration:"$cb_ManagedAddressConfiguration.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -ManagedAddressConfiguration
$cb_ManagedAddressConfiguration.Text
}
if ($cb_NeighborDiscoverySupported.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
NeighborDiscoverySupported)){
Write-Host "NeighborDiscoverySupported is same, skipping." -
ForegroundColor green}
else{
Write-Host
"NeighborDiscoverySupported:"$cb_NeighborDiscoverySupported.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -NeighborDiscoverySupported
$cb_NeighborDiscoverySupported.Text
}
if ($cb_NeighborUnreachabilityDetection.Text -eq (Get-NetIPInterface -
InterfaceAlias $NetConnectionID -AddressFamily $Global:AddressFamily | Select-
Object -Expand NeighborUnreachabilityDetection)){
Write-Host "NeighborUnreachabilityDetection is same, skipping." -
ForegroundColor green}
else{
Write-Host
"NeighborUnreachabilityDetection:"$cb_NeighborUnreachabilityDetection.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -NeighborUnreachabilityDetection
$cb_NeighborUnreachabilityDetection.Text
}
if ($cb_OtherStatefulConfiguration.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
OtherStatefulConfiguration)){
Write-Host "OtherStatefulConfiguration is same, skipping." -
ForegroundColor green}
else{
Write-Host
"OtherStatefulConfiguration:"$cb_OtherStatefulConfiguration.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -OtherStatefulConfiguration
$cb_OtherStatefulConfiguration.Text
}
if ($cb_RouterDiscovery.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
RouterDiscovery)){
Write-Host "RouterDiscovery is same, skipping." -ForegroundColor green}
else{
Write-Host "RouterDiscovery:"$cb_RouterDiscovery.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -RouterDiscovery $cb_RouterDiscovery.Text
}
if ($cb_Store.Text -eq (Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand Store)){
Write-Host "Store is same, skipping." -ForegroundColor green}
else{
Write-Host "Store:"$cb_Store.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -Store $cb_Store.Text
}
if ($cb_WeakHostReceive.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
WeakHostReceive)){
Write-Host "WeakHostReceive is same, skipping." -ForegroundColor green}
else{
Write-Host "WeakHostReceive:"$cb_WeakHostReceive.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -Store $cb_WeakHostReceive.Text
}
if ($cb_WeakHostSend.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
WeakHostSend)){
Write-Host "WeakHostSend is same, skipping." -ForegroundColor green}
else{
Write-Host "WeakHostSend:"$cb_WeakHostSend.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -Store $cb_WeakHostSend.Text
}
if ($tb_CurrentHopLimit.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
CurrentHopLimit)){
Write-Host "CurrentHopLimit is same, skipping." -ForegroundColor green}
else{
Write-Host "CurrentHopLimit:"$tb_CurrentHopLimit.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -CurrentHopLimit $tb_CurrentHopLimit.Text
}
if ($tb_BaseReachableTime.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
BaseReachableTime)){
Write-Host "BaseReachableTime is same, skipping." -ForegroundColor green}
else{
Write-Host "BaseReachableTime:"$tb_BaseReachableTime.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -BaseReachableTime $tb_BaseReachableTime.Text
}
if ($tb_ReachableTime.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ReachableTime)){
Write-Host "ReachableTime is same, skipping." -ForegroundColor green}
else{
Write-Host "ReachableTime:"$tb_ReachableTime.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -ReachableTime $tb_ReachableTime.Text
}
if ($tb_DadRetransmitTime.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
DadRetransmitTime)){
Write-Host "DadRetransmitTime is same, skipping." -ForegroundColor green}
else{
Write-Host "DadRetransmitTime:"$tb_DadRetransmitTime.Text -
ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -DadRetransmitTime $tb_DadRetransmitTime.Text
}
if ($tb_DadTransmits.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
DadTransmits)){
Write-Host "DadTransmits is same, skipping." -ForegroundColor green}
else{
Write-Host "DadTransmits:"$tb_DadTransmits.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -DadTransmits $tb_DadTransmits.Text
}
if ($tb_NlMtu.Text -eq (Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand NlMtu)){
Write-Host "NlMtu is same, skipping." -ForegroundColor green}
else{
Write-Host "NlMtu:"$tb_NlMtu.Text -ForegroundColor Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -NlMtu $tb_NlMtu.Text
}
if ($tb_RetransmitTime.Text -eq (Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
RetransmitTime)){
Write-Host "RetransmitTime is same, skipping." -ForegroundColor green}
else{
Write-Host "RetransmitTime:"$tb_RetransmitTime.Text -ForegroundColor
Green
Set-NetIPInterface -InterfaceAlias $NetConnectionID -AddressFamily
$Global:AddressFamily -RetransmitTime $tb_RetransmitTime.Text
}
}
function IPv4_CheckedChanged(){
if ($cb_IPv4.Checked){
$cb_IPv6.Enabled = $false
$Global:AddressFamily = "IPv4"
RefreshingNetIPInterfaceSettings
}else{
$cb_IPv6.Enabled = $true
$Global:AddressFamily = "IPv6"
RefreshingNetIPInterfaceSettings
}
if ($cb_IPv4.Checked -eq $false -and $cb_IPv6.Checked -eq $false -or
$cb_IPv4.Checked -eq $false -and $cb_IPv6.Visible -eq $false ){
Write-Warning "IPv4 and IPv6 are not Checked, Disabling Interface-
Settings."
$Groupbox7.Enabled = $false
$btn_applyInterfaceSettings.Enabled = $false
}else{
$Groupbox7.Enabled = $true
$btn_applyInterfaceSettings.Enabled = $true
}
}
function IPv6_CheckedChanged(){
if ($cb_IPv6.Checked){
$cb_IPv4.Enabled = $false
$Global:AddressFamily = "IPv6"
RefreshingNetIPInterfaceSettings
}else{
$cb_IPv4.Enabled = $true
$Global:AddressFamily = "IPv4"}
RefreshingNetIPInterfaceSettings
}
function RefreshingNetIPInterfaceSettings{
#NetIPInterface
#AdvertiseDefaultRoute
$cb_AdvertiseDefaultRoute.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
AdvertiseDefaultRoute
#Advertising
$cb_Advertising.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand Advertising
#AutomaticMetric
$cb_AutomaticMetric.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
AutomaticMetric
#ClampMss
$cb_ClampMss.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand ClampMss
#DirectedMacWolPattern
$cb_DirectedMacWolPattern.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
DirectedMacWolPattern
#EcnMarking
$cb_EcnMarking.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand EcnMarking
#ForceArpNdWolPattern
$cb_ForceArpNdWolPattern.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ForceArpNdWolPattern
#Forwarding
$cb_Forwarding.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand Forwarding
#IgnoreDefaultRoutes
$cb_IgnoreDefaultRoutes.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
IgnoreDefaultRoutes
#ManagedAddressConfiguration
$cb_ManagedAddressConfiguration.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ManagedAddressConfiguration
#NeighborDiscoverySupported
$cb_NeighborDiscoverySupported.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
NeighborDiscoverySupported
#NeighborUnreachabilityDetection
$cb_NeighborUnreachabilityDetection.Text = Get-NetIPInterface -
InterfaceAlias $NetConnectionID -AddressFamily $Global:AddressFamily | Select-
Object -Expand NeighborUnreachabilityDetection
#OtherStatefulConfiguration
$cb_OtherStatefulConfiguration.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
OtherStatefulConfiguration
#RouterDiscovery
$cb_RouterDiscovery.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
RouterDiscovery
#Store
$cb_Store.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand Store
#WeakHostReceive
$cb_WeakHostReceive.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
WeakHostReceive
#WeakHostSend
$cb_WeakHostSend.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
WeakHostSend
#CurrentHopLimit
#When this parameter value is set to 0, it uses this default.
$tb_CurrentHopLimit.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
CurrentHopLimit
#BaseReachableTime
#Specifies the base value for random reachable time, in milliseconds. For
more information, see RFC 2461.
#The default value is 30000.
$tb_BaseReachableTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
BaseReachableTime
#ReachableTime
#Specifies an array of reachable time values. This parameter is the time,
in milliseconds, that a node assumes that a neighbor
#is reachable after having received a reachability confirmation. This
parameter works with the NeighborUnreachabilityDetection parameter.
$tb_ReachableTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
ReachableTime
#DadRetransmitTime
#Specifies a value for the time interval between neighbor solicitation
messages.
$tb_DadRetransmitTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
DadRetransmitTime
#DadTransmits
#Specifies a value for the number of consecutive messages sent while the
network driver performs duplicate address detection.
$tb_DadTransmits.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID
-AddressFamily $Global:AddressFamily | Select-Object -Expand DadTransmits
#NlMtu
#Specifies the network layer Maximum Transmission Unit (MTU) value, in
bytes, for an IP interface.
#For IPv4 the minimum value is 576 bytes. For IPv6 the minimum is value is
1280 bytes.
#For both IPv4 and IPv6, the maximum value is 2^32-1 (4294967295). You
cannot set values outside these ranges.
#If this parameter is set to 0, then it will remain unchanged and maintain
its current value. The IP interface will not transmit packets larger than the
maximum value.
$tb_NlMtu.Text = Get-NetIPInterface -InterfaceAlias $NetConnectionID -
AddressFamily $Global:AddressFamily | Select-Object -Expand NlMtu
#RetransmitTime (RetransmitTimeMs)
#Specifies a value for timeout and retransmission, in milliseconds, for
Neighbor Solicitation messages.
#For more information, see RetransTimer in RFC 2461.
#By default, the value is set to 1000.
$tb_RetransmitTime.Text = Get-NetIPInterface -InterfaceAlias
$NetConnectionID -AddressFamily $Global:AddressFamily | Select-Object -Expand
RetransmitTime
function applyall{
if($Groupbox7.Enabled -eq $False){
Write-Host "Applying All Settings!" -ForegroundColor Yellow
Write-Host "`n"
Write-Host "===== Global Settings =====" -ForegroundColor Yellow
applyglobal
Write-Host "`n"
Write-Host "===== RSS Settings =====" -ForegroundColor Yellow
applyrsssettings
Write-Host "`n"
Write-Host "===== PowerSaving Settings =====" -ForegroundColor Yellow
applypowersavingsettings
Write-Host "`n"
Write-Warning "===== IP-Interface Settings ====="
Write-Warning "IPv4 or IPv6 not specified!"
Write-Host "`n"
Write-Host "===== Adapter Advanced Settings =====" -ForegroundColor Yellow
applyadvsettings
}else{
Write-Host "Applying All Settings!" -ForegroundColor Yellow
function RegistryTweaks{
#$ErrorActionPreference = 'Continue'
#DefaultReceiveWindow
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DefaultReceiveWindow")
if ($A -eq $false -and $cb_Afd_defaultrecWin.Text -ne $null -and
$cb_Afd_defaultrecWin.Text -ne '' ){
Write-Host "Set AFDDefaultReceiveWindow
to"$cb_Afd_defaultrecWin.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DefaultReceiveWindow" -Typ
"Dword" -Value $cb_Afd_defaultrecWin.Text -Force
}elseif($A -eq $true -and $cb_Afd_defaultrecWin.Text -eq $null -or
$cb_Afd_defaultrecWin.Text -eq ''){
Write-Warning "Removing AFDDefaultReceiveWindow"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DefaultReceiveWindow"
}else{
Write-Host "Set AFDDefaultReceiveWindow
to"$cb_Afd_defaultrecWin.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DefaultReceiveWindow" -Value
$cb_Afd_defaultrecWin.Text -Force
}
#DefaultSendWindow
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DefaultSendWindow")
if ($A -eq $false -and $cb_Afd_defaultSendWin.Text -ne $null -and
$cb_Afd_defaultSendWin.Text -ne '' ){
Write-Host "Set AFDDefaultSendWindow
to"$cb_Afd_defaultSendWin.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DefaultSendWindow" -Typ "Dword" -
Value $cb_Afd_defaultSendWin.Text -Force
}elseif($A -eq $true -and $cb_Afd_defaultSendWin.Text -eq $null -or
$cb_Afd_defaultSendWin.Text -eq ''){
Write-Warning "Removing AFDDefaultSendWindow"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DefaultSendWindow"
}else{
Write-Host "Set AFDDefaultSendWindow
to"$cb_Afd_defaultSendWin.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DefaultSendWindow" -Value
$cb_Afd_defaultSendWin.Text -Force
}
#DisableAddressSharing
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DisableAddressSharing")
if ($A -eq $false -and $cb_DisableAddressSharing.Text -ne $null -and
$cb_DisableAddressSharing.Text -ne '' ){
Write-Host "Set AFDDisableAddressSharing
to"$cb_DisableAddressSharing.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableAddressSharing" -Typ
"Dword" -Value $cb_DisableAddressSharing.Text -Force
}elseif($A -eq $true -and $cb_DisableAddressSharing.Text -eq $null -or
$cb_DisableAddressSharing.Text -eq ''){
Write-Warning "Removing AFDDisableAddressSharing"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableAddressSharing"
}else{
Write-Host "Set AFDDisableAddressSharing
to"$cb_DisableAddressSharing.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableAddressSharing" -Value
$cb_DisableAddressSharing.Text -Force
}
#BufferMultiplier
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"BufferMultiplier")
if ($A -eq $false -and $cb_BufferMultiplier.Text -ne $null -and
$cb_BufferMultiplier.Text -ne '' ){
Write-Host "Set AFDBufferMultiplier to"$cb_BufferMultiplier.Text
-ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferMultiplier" -Typ "Dword" -
Value $cb_BufferMultiplier.Text -Force
}elseif($A -eq $true -and $cb_BufferMultiplier.Text -eq $null -or
$cb_BufferMultiplier.Text -eq ''){
Write-Warning "Removing AFDBufferMultiplier"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferMultiplier"
}else{
Write-Host "Set AFDBufferMultiplier to"$cb_BufferMultiplier.Text
-ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferMultiplier" -Value
$cb_BufferMultiplier.Text -Force
}
#BufferAlignment
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"BufferAlignment")
if ($A -eq $false -and $cb_BufferAlignment.Text -ne $null -and
$cb_BufferAlignment.Text -ne '' ){
Write-Host "Set AFDBufferAlignment to"$cb_BufferAlignment.Text -
ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferAlignment" -Typ "Dword" -
Value $cb_BufferAlignment.Text -Force
}elseif($A -eq $true -and $cb_BufferAlignment.Text -eq $null -or
$cb_BufferAlignment.Text -eq ''){
Write-Warning "Removing AFDBufferAlignment"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferAlignment"
}else{
Write-Host "Set AFDBufferAlignment to"$cb_BufferAlignment.Text -
ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "BufferAlignment" -Value
$cb_BufferAlignment.Text -Force
}
#DoNotHoldNICBuffers
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DoNotHoldNICBuffers")
if ($A -eq $false -and $cb_DoNotHoldNICBuffers.Text -ne $null -and
$cb_DoNotHoldNICBuffers.Text -ne '' ){
Write-Host "Set AFDDoNotHoldNICBuffers
to"$cb_DoNotHoldNICBuffers.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DoNotHoldNICBuffers" -Typ "Dword"
-Value $cb_DoNotHoldNICBuffers.Text -Force
}elseif($A -eq $true -and $cb_DoNotHoldNICBuffers.Text -eq $null -or
$cb_DoNotHoldNICBuffers.Text -eq ''){
Write-Warning "Removing AFDDoNotHoldNICBuffers"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DoNotHoldNICBuffers"
}else{
Write-Host "Set AFDDoNotHoldNICBuffers
to"$cb_DoNotHoldNICBuffers.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DoNotHoldNICBuffers" -Value
$cb_DoNotHoldNICBuffers.Text -Force
}
#SmallBufferSize
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"SmallBufferSize")
if ($A -eq $false -and $cb_SmallBufferSize.Text -ne $null -and
$cb_SmallBufferSize.Text -ne '' ){
Write-Host "Set AFDSmallBufferSize to"$cb_SmallBufferSize.Text -
ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferSize" -Typ "Dword" -
Value $cb_SmallBufferSize.Text -Force
}elseif($A -eq $true -and $cb_SmallBufferSize.Text -eq $null -or
$cb_SmallBufferSize.Text -eq ''){
Write-Warning "Removing AFDSmallBufferSize"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferSize"
}else{
Write-Host "Set AFDSmallBufferSize to"$cb_SmallBufferSize.Text -
ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferSize" -Value
$cb_SmallBufferSize.Text -Force
}
#MediumBufferSize
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"MediumBufferSize")
if ($A -eq $false -and $cb_MediumBufferSize.Text -ne $null -and
$cb_MediumBufferSize.Text -ne '' ){
Write-Host "Set AFDMediumBufferSize to"$cb_MediumBufferSize.Text
-ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferSize" -Typ "Dword" -
Value $cb_MediumBufferSize.Text -Force
}elseif($A -eq $true -and $cb_MediumBufferSize.Text -eq $null -or
$cb_MediumBufferSize.Text -eq ''){
Write-Warning "Removing AFDMediumBufferSize"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferSize"
}else{
Write-Host "Set AFDMediumBufferSize to"$cb_MediumBufferSize.Text
-ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferSize" -Value
$cb_MediumBufferSize.Text -Force
}
#LargeBufferSize
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"LargeBufferSize")
if ($A -eq $false -and $cb_LargeBufferSize.Text -ne $null -and
$cb_LargeBufferSize.Text -ne '' ){
Write-Host "Set AFDLargeBufferSize to"$cb_LargeBufferSize.Text -
ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "LargeBufferSize" -Typ "Dword" -
Value $cb_LargeBufferSize.Text -Force
}elseif($A -eq $true -and $cb_LargeBufferSize.Text -eq $null -or
$cb_LargeBufferSize.Text -eq ''){
Write-Warning "Removing AFDLargeBufferSize"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "LargeBufferSize"
}else{
Write-Host "Set AFDLargeBufferSize to"$cb_LargeBufferSize.Text -
ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "LargeBufferSize" -Value
$cb_LargeBufferSize.Text -Force
}
#HugeBufferSize
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"HugeBufferSize")
if ($A -eq $false -and $cb_HugeBufferSize.Text -ne $null -and
$cb_HugeBufferSize.Text -ne '' ){
Write-Host "Set AFDHugeBufferSize to"$cb_HugeBufferSize.Text -
ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "HugeBufferSize" -Typ "Dword" -
Value $cb_HugeBufferSize.Text -Force
}elseif($A -eq $true -and $cb_HugeBufferSize.Text -eq $null -or
$cb_HugeBufferSize.Text -eq ''){
Write-Warning "Removing AFDHugeBufferSize"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "HugeBufferSize"
}else{
Write-Host "Set AFDHugeBufferSize to"$cb_HugeBufferSize.Text -
ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "HugeBufferSize" -Value
$cb_HugeBufferSize.Text -Force
}
#SmallBufferListDepth
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"SmallBufferListDepth")
if ($A -eq $false -and $cb_SmallBufferListDepth.Text -ne $null -and
$cb_SmallBufferListDepth.Text -ne '' ){
Write-Host "Set AFDSmallBufferListDepth
to"$cb_SmallBufferListDepth.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferListDepth" -Typ
"Dword" -Value $cb_SmallBufferListDepth.Text -Force
}elseif($A -eq $true -and $cb_SmallBufferListDepth.Text -eq $null -or
$cb_SmallBufferListDepth.Text -eq ''){
Write-Warning "Removing AFDSmallBufferListDepth"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferListDepth"
}else{
Write-Host "Set AFDSmallBufferListDepth
to"$cb_SmallBufferListDepth.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "SmallBufferListDepth" -Value
$cb_SmallBufferListDepth.Text -Force
}
#MediumBufferListDepth
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"MediumBufferListDepth")
if ($A -eq $false -and $cb_MediumBufferListDepth.Text -ne $null -and
$cb_MediumBufferListDepth.Text -ne '' ){
Write-Host "Set AFDMediumBufferListDepth
to"$cb_MediumBufferListDepth.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferListDepth" -Typ
"Dword" -Value $cb_MediumBufferListDepth.Text -Force
}elseif($A -eq $true -and $cb_MediumBufferListDepth.Text -eq $null -or
$cb_MediumBufferListDepth.Text -eq ''){
Write-Warning "Removing AFDMediumBufferListDepth"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferListDepth"
}else{
Write-Host "Set AFDMediumBufferListDepth
to"$cb_MediumBufferListDepth.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "MediumBufferListDepth" -Value
$cb_MediumBufferListDepth.Text -Force
}
#LargBufferListDepth
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"LargBufferListDepth")
if ($A -eq $false -and $cb_LargBufferListDepth.Text -ne $null -and
$cb_LargBufferListDepth.Text -ne '' ){
Write-Host "Set AFDLargBufferListDepth
to"$cb_LargBufferListDepth.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "LargBufferListDepth" -Typ "Dword"
-Value $cb_LargBufferListDepth.Text -Force
}elseif($A -eq $true -and $cb_LargBufferListDepth.Text -eq $null -or
$cb_LargBufferListDepth.Text -eq ''){
Write-Warning "Removing AFDLargBufferListDepth"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "LargBufferListDepth"
}else{
Write-Host "Set AFDLargBufferListDepth
to"$cb_LargBufferListDepth.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "LargBufferListDepth" -Value
$cb_LargBufferListDepth.Text -Force
}
#DisableDirectAcceptEx
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DisableDirectAcceptEx")
if ($A -eq $false -and $cb_DisableDirectAcceptEx.Text -ne $null -and
$cb_DisableDirectAcceptEx.Text -ne '' ){
Write-Host "Set AFDDisableDirectAcceptEx
to"$cb_DisableDirectAcceptEx.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableDirectAcceptEx" -Typ
"Dword" -Value $cb_DisableDirectAcceptEx.Text -Force
}elseif($A -eq $true -and $cb_DisableDirectAcceptEx.Text -eq $null -or
$cb_DisableDirectAcceptEx.Text -eq ''){
Write-Warning "Removing AFDDisableDirectAcceptEx"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableDirectAcceptEx"
}else{
Write-Host "Set AFDDisableDirectAcceptEx
to"$cb_DisableDirectAcceptEx.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableDirectAcceptEx" -Value
$cb_DisableDirectAcceptEx.Text -Force
}
#DisableChainedReceive
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DisableChainedReceive")
if ($A -eq $false -and $cb_DisableChainedReceive.Text -ne $null -and
$cb_DisableChainedReceive.Text -ne '' ){
Write-Host "Set AFDDisableChainedReceive
to"$cb_DisableChainedReceive.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableChainedReceive" -Typ
"Dword" -Value $cb_DisableChainedReceive.Text -Force
}elseif($A -eq $true -and $cb_DisableChainedReceive.Text -eq $null -or
$cb_DisableChainedReceive.Text -eq ''){
Write-Warning "Removing AFDDisableChainedReceive"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableChainedReceive"
}else{
Write-Host "Set AFDDisableChainedReceive
to"$cb_DisableChainedReceive.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableChainedReceive" -Value
$cb_DisableChainedReceive.Text -Force
}
#DisableRawSecurity
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DisableRawSecurity")
if ($A -eq $false -and $cb_DisableRawSecurity.Text -ne $null -and
$cb_DisableRawSecurity.Text -ne '' ){
Write-Host "Set AFDDisableRawSecurity
to"$cb_DisableRawSecurity.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableRawSecurity" -Typ "Dword"
-Value $cb_DisableRawSecurity.Text -Force
}elseif($A -eq $true -and $cb_DisableRawSecurity.Text -eq $null -or
$cb_DisableRawSecurity.Text -eq ''){
Write-Warning "Removing AFDDisableRawSecurity"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableRawSecurity"
}else{
Write-Host "Set AFDDisableRawSecurity
to"$cb_DisableRawSecurity.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DisableRawSecurity" -Value
$cb_DisableRawSecurity.Text -Force
}
#DynamicSendBufferDisable
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"DynamicSendBufferDisable")
if ($A -eq $false -and $cb_DynamicSendBufferDisable.Text -ne $null -and
$cb_DynamicSendBufferDisable.Text -ne '' ){
Write-Host "Set AFDDynamicSendBufferDisable
to"$cb_DynamicSendBufferDisable.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DynamicSendBufferDisable" -Typ
"Dword" -Value $cb_DynamicSendBufferDisable.Text -Force
}elseif($A -eq $true -and $cb_DynamicSendBufferDisable.Text -eq $null -
or $cb_DynamicSendBufferDisable.Text -eq ''){
Write-Warning "Removing AFDDynamicSendBufferDisable"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DynamicSendBufferDisable"
}else{
Write-Host "Set AFDDynamicSendBufferDisable
to"$cb_DynamicSendBufferDisable.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "DynamicSendBufferDisable" -Value
$cb_DynamicSendBufferDisable.Text -Force
}
#FastSendDatagramThreshold
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"FastSendDatagramThreshold")
if ($A -eq $false -and $cb_FastSendDatagramThreshold.Text -ne $null -
and $cb_FastSendDatagramThreshold.Text -ne '' ){
Write-Host "Set AFDFastSendDatagramThreshold
to"$cb_FastSendDatagramThreshold.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "FastSendDatagramThreshold" -Typ
"Dword" -Value $cb_FastSendDatagramThreshold.Text -Force
}elseif($A -eq $true -and $cb_FastSendDatagramThreshold.Text -eq $null
-or $cb_FastSendDatagramThreshold.Text -eq ''){
Write-Warning "Removing AFDFastSendDatagramThreshold"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "FastSendDatagramThreshold"
}else{
Write-Host "Set AFDFastSendDatagramThreshold
to"$cb_FastSendDatagramThreshold.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "FastSendDatagramThreshold" -Value
$cb_FastSendDatagramThreshold.Text -Force
}
#FastCopyReceiveThreshold
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"FastCopyReceiveThreshold")
if ($A -eq $false -and $cb_FastCopyReceiveThreshold.Text -ne $null -and
$cb_FastCopyReceiveThreshold.Text -ne '' ){
Write-Host "Set AFDFastCopyReceiveThreshold
to"$cb_FastCopyReceiveThreshold.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "FastCopyReceiveThreshold" -Typ
"Dword" -Value $cb_FastCopyReceiveThreshold.Text -Force
}elseif($A -eq $true -and $cb_FastCopyReceiveThreshold.Text -eq $null -
or $cb_FastCopyReceiveThreshold.Text -eq ''){
Write-Warning "Removing AFDFastCopyReceiveThreshold"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "FastCopyReceiveThreshold"
}else{
Write-Host "Set AFDFastCopyReceiveThreshold
to"$cb_FastCopyReceiveThreshold.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "FastCopyReceiveThreshold" -Value
$cb_FastCopyReceiveThreshold.Text -Force
}
#IgnorePushBitOnReceives
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"IgnorePushBitOnReceives")
if ($A -eq $false -and $cb_IgnorePushBitOnReceives.Text -ne $null -and
$cb_IgnorePushBitOnReceives.Text -ne '' ){
Write-Host "Set AFDIgnorePushBitOnReceives
to"$cb_IgnorePushBitOnReceives.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "IgnorePushBitOnReceives" -Typ
"Dword" -Value $cb_IgnorePushBitOnReceives.Text -Force
}elseif($A -eq $true -and $cb_IgnorePushBitOnReceives.Text -eq $null -
or $cb_IgnorePushBitOnReceives.Text -eq ''){
Write-Warning "Removing AFDIgnorePushBitOnReceives"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "IgnorePushBitOnReceives"
}else{
Write-Host "Set AFDIgnorePushBitOnReceives
to"$cb_IgnorePushBitOnReceives.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "IgnorePushBitOnReceives" -Value
$cb_IgnorePushBitOnReceives.Text -Force
}
#IgnoreOrderlyRelease
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"IgnoreOrderlyRelease")
if ($A -eq $false -and $cb_IgnoreOrderlyRelease.Text -ne $null -and
$cb_IgnoreOrderlyRelease.Text -ne '' ){
Write-Host "Set AFDIgnoreOrderlyRelease
to"$cb_IgnoreOrderlyRelease.Text -ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "IgnoreOrderlyRelease" -Typ
"Dword" -Value $cb_IgnoreOrderlyRelease.Text -Force
}elseif($A -eq $true -and $cb_IgnoreOrderlyRelease.Text -eq $null -or
$cb_IgnoreOrderlyRelease.Text -eq ''){
Write-Warning "Removing AFDIgnoreOrderlyRelease"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "IgnoreOrderlyRelease"
}else{
Write-Host "Set AFDIgnoreOrderlyRelease
to"$cb_IgnoreOrderlyRelease.Text -ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "IgnoreOrderlyRelease" -Value
$cb_IgnoreOrderlyRelease.Text -Force
}
#TransmitWorker
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"TransmitWorker")
if ($A -eq $false -and $cb_TransmitWorker.Text -ne $null -and
$cb_TransmitWorker.Text -ne '' ){
Write-Host "Set AFDTransmitWorker to"$cb_TransmitWorker.Text -
ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "TransmitWorker" -Typ "Dword" -
Value $cb_TransmitWorker.Text -Force
}elseif($A -eq $true -and $cb_TransmitWorker.Text -eq $null -or
$cb_TransmitWorker.Text -eq ''){
Write-Warning "Removing AFDTransmitWorker"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "TransmitWorker"
}else{
Write-Host "Set AFDTransmitWorker to"$cb_TransmitWorker.Text -
ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "TransmitWorker" -Value
$cb_TransmitWorker.Text -Force
}
#PriorityBoost
$A=((Get-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters").PSObject.Properties.Name -contains
"PriorityBoost")
if ($A -eq $false -and $cb_PriorityBoost.Text -ne $null -and
$cb_PriorityBoost.Text -ne '' ){
Write-Host "Set AFDPriorityBoost to"$cb_PriorityBoost.Text -
ForegroundColor Green
New-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "PriorityBoost" -Typ "Dword" -
Value $cb_PriorityBoost.Text -Force
}elseif($A -eq $true -and $cb_PriorityBoost.Text -eq $null -or
$cb_PriorityBoost.Text -eq ''){
Write-Warning "Removing AFDPriorityBoost"
Remove-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "PriorityBoost"
}else{
Write-Host "Set AFDPriorityBoost to"$cb_PriorityBoost.Text -
ForegroundColor Green
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\AFD\Parameters" -Name "PriorityBoost" -Value
$cb_PriorityBoost.Text -Force
}
function Opacity {
$modes = @{OpacityOn = "0.90"; OpacityOff = "1"}
$Form.Opacity = $(if ($Form.Opacity -eq $modes.OpacityOn){ $modes.OpacityOff }
else { $modes.OpacityOn})
function HWSettings {
$btn_InterruptApply.Add_Click({cls; HWSettings})
$btn_registrytweaksapply.Add_Click({cls; RegistryTweaks})
$cb_IPv4.Add_CheckedChanged({ IPv4_CheckedChanged })
$cb_IPv6.Add_CheckedChanged({ IPv6_CheckedChanged })
$btn_applyInterfaceSettings.Add_Click({cls; ApplyInterfaceSettings})
$btn_openreg.Add_Click({btn_regopadap})
$btn_adaptrest.Add_Click({cls; adapter_restart})
$btn_applyadv.Add_Click({cls; applyadvsettings})
$btn_applyglobal.Add_Click({cls; applyglobal })
#$btn_applotadapters.Add_Click({applyotAdapters})
$btn_apply.Add_Click({ cls; applyrsssettings })
# Source: https://community.spiceworks.com/topic/2239276-script-help-to-disable-
power-management-on-network-cards
$btn_applypowersettings.Add_Click({cls; applypowersavingsettings})
$btn_applyall.Add_Click({cls; applyall})
$btn_rssaddsupport.Add_Click({cls; RSSEnable})
$btn_unqueues.Add_Click({cls; RSSQueuesUnlock})
$btn_Opacity.Add_Click({Opacity})
#Notes:
# Adding Additional Settings for Adv Tweaking
#endregion
[void]$Form.ShowDialog()