CiscoDevNet / intersight-powershell

Cisco Intersight PowerShell
Apache License 2.0
16 stars 4 forks source link

Get-IntersightServerProfile discrepancy #157

Closed safabianb1991 closed 2 months ago

safabianb1991 commented 2 months ago

Describe the bug Get-IntersightServerProfile | Select-Object Name | ?{$_.Name -eq "NameOfTheProfile"} the profile is not visible. But if i use the following method, i getting all the information.

Get-IntersightServerProfile -Name NameOfTheProfile | Select-Object Name

To Reproduce Steps to reproduce the behavior

Version used

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

briamorr commented 2 months ago

If you check the output of Get-IntersightServerProfile -Count $true do you have more than 100 profiles? If so, you can try specifying the $top command up to a maximum of 1000 objects:

Get-IntersightServerProfile -Top 1000 | Select-Object -Expand Results | Select Name | ?{$_.Name -eq "NameOfTheProfile"}

If you have more than 1000 profiles you will then need to paginate the requests or use server side filtering like you had done with -Name

safabianb1991 commented 2 months ago

Great, thanks, it is now OK!