davesnb
asked on
Comparing two variable properties
I have 2 variables with the same property values ( computername) . I wish to find the value that does not match . So below , I have my list of computers in var pageresponse in a invoke-webrequest stored variable .
And , i also have a list of "started" computers in a stored variable of var publicstarted of property $publicstarted.pscomputern ame
So I just wish to compare the 2 and return the value that is not matching , so in this example, iasc9-web34 should be returned and stored in a new var.
Your help is appreciated.
$pageresponse.pscomputername
iasc9-web04
iasc9-web05
iasc9-web06
iasc9-web07
iasc9-web15
iasc9-web16
iasc9-web25
iasc9-web26
iasc9-web27
iasc9-web28
iasc9-web29
iasc9-web30
iasc9-web31
iasc9-web32
iasc9-web33
And , i also have a list of "started" computers in a stored variable of var publicstarted of property $publicstarted.pscomputern
$publicstarted.pscomputername
iasc9-web04
iasc9-web05
iasc9-web06
iasc9-web07
iasc9-web15
iasc9-web16
iasc9-web25
iasc9-web26
iasc9-web27
iasc9-web28
iasc9-web29
iasc9-web30
iasc9-web31
iasc9-web32
iasc9-web33
iasc9-web34
So I just wish to compare the 2 and return the value that is not matching , so in this example, iasc9-web34 should be returned and stored in a new var.
Your help is appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, thank you the first worked !
Open in new window