Created
October 12, 2017 13:10
-
-
Save dotps1/c9b9b859cfbe2a74e961fb21d28f9780 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration Hypervisor { | |
Import-DscResource -ModuleName PSDesiredStateConfiguration | |
Node $AllNodes.NodeName { | |
WindowsFeatureSet RequiredFeatures { | |
Name = @( | |
"Failover-Clustering", "Hyper-V", "Multipath-IO" | |
) | |
Ensure = "Present" | |
} | |
$adapters = Get-NetAdapter | | |
Where-Object { | |
$_.InterfaceDescription -like "Chelsio*" -and $_.MacAddress -like "*8" | |
} | |
foreach ($adapter in $adapters) { | |
Script JumboPacket { | |
GetScript = { | |
$jumboPacketValue = Get-NetAdapterAdvancedProperty -InterfaceAlias $using:adapter.InterfaceAlias -DisplayName "Jumbo Packet" | | |
Select-Object -ExpandProperty DisplayValue | |
return @{ | |
"JumboPacketValue" = "$jumboPacketValue" | |
} | |
} | |
TestScript = { | |
$jumboPacketValue = $GetScript | |
if ($jumboPacketValue -eq "9014 Bytes") { | |
return $true | |
} else { | |
return $false | |
} | |
} | |
SetScript = { | |
Set-NetAdapterAdvancedProperty -InterfaceAlias $using:adapter.InterfaceAlias -DisplayName "Jumbo Packet" -DisplayValue "9014 Bytes" -Confirm:$false | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment