Closed magrossm closed 5 years ago
According to the underlying API documentation, windowId
is a required parameter, so a failure in using the cmdlet with a $null
value is expected.
Could you just exclude nulls from your list?
$mws = (Get-SSMMaintenanceWindowList -Region eu-west-1).WindowId | Where { $null -ne $_ }
ForEach ($item in $mws)
{
Dear All,
I have following function
The problem is that sometimes $val equals $null because the .Values in JSON are not existentn.
I get following error.
Any ideas? It works if an istance itself is registered to a maintenance window as a target but i want the loop to work if a member of the resulting array is null.