I have a script that checks the resources of a Failover cluster. What I would like to have is a default value of the state set to offline to show offline resources if the parameter state is omitted. However what I am finding is that the way I have written is showing online resources even if the -parameter state is omitted
My script is below:
# Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.89
# Created on: 5/08/2015 11:59 a.m.
# Created by: weiyentan
# Filename: Get-ClusterResourceState.ps1
Get-ClusterResourceState -clustername 'Cluster1'
This will show you the resources of the cluster Cluster1 that is listed OFFLINE
PS C:\> Get-ClusterResourceState -clustername 'Cluster1' -state 'online'
This will check the cluster Cluster1 and check all the resources that are online.