Skip to content

Instantly share code, notes, and snippets.

@dotps1
Created October 12, 2017 13:10
Show Gist options
  • Save dotps1/c9b9b859cfbe2a74e961fb21d28f9780 to your computer and use it in GitHub Desktop.
Save dotps1/c9b9b859cfbe2a74e961fb21d28f9780 to your computer and use it in GitHub Desktop.
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