cohesity / cohesity-powershell-module

This repository provides a PowerShell Module for Cohesity DataPlatform. https://cohesity.github.io/cohesity-powershell-module
Apache License 2.0
42 stars 16 forks source link

1.8.1 bug Get-CohesityMSSQLObject no longer stores results into a variable #200

Closed jason-carter-bzy closed 2 years ago

jason-carter-bzy commented 2 years ago

🐛 Bug Report

We use Get-CohesityMSSQLObject to store the results of all SQL objects for later searches rather than query cohesity again, this appears to have broken since 1.8.1. This is a simple one liner.

To Reproduce

(Write your steps here:)

  1. Connect-CohesityCluster
  2. $mssqlcache = Get-CohesityMSSQLObject | Where {$_.Environment -eq "kSQL"}

Expected behavior

PS P:> $mssqlcache = Get-CohesityMSSQLObject | Where {$_.Environment -eq "kSQL"}

PS P:> $mssqlcache.Count 6616

PS P:> foreach ($s in $mssqlcache) {write $s.SqlProtectionSource.DatabaseName}

List of databases

Actual Behavior

Get-CohesityMSSQLObject : Error converting value "token=" to type 'System.Collections.Generic.List`1[System.Int32]'. Path '[0].applicationServer.applicationNodes[0].nodes[0].protectionSource.sqlProtectionSource.id.instanceId', line 1, position 297. At line:1 char:15

(Write what happened. Add screenshots, if applicable.)

The command errored with the above. I have replaced token= as it had an actual token which I did not want to add in this ticket.

KavishreeShanmugam11 commented 2 years ago

ACK

KavishreeShanmugam11 commented 2 years ago

@jason-carter-bzy This happens due to incorrect field type defined in the model (in v6.8.1 cluster version, which we used in powershell) for SQL protection source's instance id. We are working on it to fix it.

jason-carter-bzy commented 2 years ago

@jason-carter-bzy This happens due to incorrect field type defined in the model (in v6.8.1 cluster version, which we used in powershell) for SQL protection source's instance id. We are working on it to fix it.

that's great thanks.

jason-carter-bzy commented 2 years ago

this method is working in 1.8.2 thanks