You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if I run this cmdlet to retrieve the list of all Folders belonging to Category Id 187:
Get-FreshServiceSolutionFolder -category_id 187
...I have no results.
I analyzed the Get-FreshServiceSolutionFolder.ps1 script included in FreshservicePS module:
$results = do {
$params = @{
Uri = $uri
Method = 'GET'
ErrorAction = 'Stop'
}
$result = Invoke-FreshworksRestMethod @params
if ($result.Content) {
$content = $result.Content |
ConvertFrom-Json
#API returns singluar or plural property based on the number of records, parse to get property returned.
$objProperty = $content[0].PSObject.Properties.Name
Write-Verbose -Message ("Returning {0} property with count {1}" -f $objProperty, $content."$($objProperty)".Count)
$content."$($objProperty)"
}
if ($result.Headers.Link) {
$uri = [regex]::Matches($result.Headers.Link,'<(?<Uri>.*)>')[0].Groups['Uri'].Value
}
}
until (!$result.Headers.Link)
When there is one result the $content[0].PSObjects.Properties.Name returns one property folder; but when there are multiple results there are two properties returned folders and meta ($objProperty is equal to System.Object[]). So I suppose the problem is related to how the (multiple) results are handled by the function.
I don't exclude this behavior could affect all other Get-Freshservice* cmdlets.
The text was updated successfully, but these errors were encountered:
Hello,
the Get-FreshServiceSolutionFolder cmdlet doesn't work when multiple results are returning (FreshservicePS module version 0.1.6).
If I run this cmdlet to retrieve the list of a Folder with Id 66175 belonging to Category with Id 187:
Get-FreshServiceSolutionFolder -Id 66175 -category_id 187
...this is the result:
But if I run this cmdlet to retrieve the list of all Folders belonging to Category Id 187:
Get-FreshServiceSolutionFolder -category_id 187
...I have no results.
I analyzed the Get-FreshServiceSolutionFolder.ps1 script included in FreshservicePS module:
When there is one result the
$content[0].PSObjects.Properties.Name
returns one propertyfolder
; but when there are multiple results there are two properties returnedfolders
andmeta
($objProperty
is equal to System.Object[]). So I suppose the problem is related to how the (multiple) results are handled by the function.I don't exclude this behavior could affect all other Get-Freshservice* cmdlets.
The text was updated successfully, but these errors were encountered: