Microsoft Virtualization Discussions

Compare-Object problems

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


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



Re: Compare-Object problems

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                                                       =>

e0a                                                       <=

e4c                                                                             <=

e4d                                                                             <=

Cloud Volumes ONTAP
Review Banner
All Community Forums