Microsoft Virtualization Discussions

Compare-Object problems

sjallabais
2,552 Views

Compare-Object does not seem to work on all Toolkit objects.

Examples:

Compare-Object (Get-NaNetPersistentConfig) (Get-NaNetActiveConfig)

Compare-Object (Get-NaLicense -controller $netapp1a) (Get-NaLicense -controller $netapp1b)

Both returns nothing when there are obvious differences.

Compare-Object (Get-NaOption -controller $netapp1a) (Get-NaOption -controller $netapp1b)

Works like it should.

I'm running Toolkit 1.4 and OnTAP 8.0.2RC1

/Sjalla

1 REPLY 1

timothyn
2,552 Views

Hi Sjalla,

You can provide more information to Compare-Object so it will understand what you want to compare.

For licenses you can specify the Service & Licensed properties:

PS C:\> Compare-Object (Get-NaLicense -contr $mcb) (Get-NaLicense -contr $mca) -Property Service, Licensed

Service                                                                Licensed SideIndicator

-------                                                                -------- -------------

disk_sanitization                                                          True =>

flex_clone                                                                False =>

disk_sanitization                                                         False <=

flex_clone                                                                 True <=

And for the network config, you'll need to drill down a bit more into the object:

PS C:\> $net1 = Get-NaNetActiveConfig -Controller $mca

PS C:\> $net2 = Get-NaNetActiveConfig -Controller $mcb

PS C:\> Compare-Object $net1.Interfaces $net2.Interfaces -Property Interface,PrimaryAddresses

Interface                               PrimaryAddresses                        SideIndicator

---------                               ----------------                        -------------

e0a                                     10.61.132.11                            =>

e0a                                     10.61.132.10                            <=

e4c                                                                             <=

e4d                                                                             <=

Public