Splat parameters to a cmdlet without unrolling array Splat parameters to a cmdlet without unrolling array powershell powershell

Splat parameters to a cmdlet without unrolling array


As in comments, my issue was being cause by the iLO itself/logic rather than the splat being incorrect. My original code does indeed work as intended:

$dnstype = ,@("Primary","Secondary","Tertiary")$dnsserver = ,@("192.168.1.11","192.168.1.12","192.168.150.13")$NewDCHPv4Settings = @{    Connection    = $connection    InterfaceType = "Dedicated"    OutVariable   = "IPv4Set"    OutputType    = "Object"    DNSName       = $ShortName.ToLower()    ErrorAction   = "Stop"    Verbose       = $true}# Check DNS and amend if requiredif ($IPv4Settings.DNSServer -ne $dnsserver) {    Write-Host "DNS server entries not correct, amending"    $NewDCHPv4Settings.Add("DNSServer", $dnsserver)    $NewDCHPv4Settings.Add("DNSServerType", $dnstype)}Set-HPEiLOIPv4NetworkSetting @NewDCHPv4Settings