Azure / Azure/azure-powershell
Get-AzSentinelIncident "-top" switch does not work.
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
The Get-AzSentinelIncident switch "-top" does not list the number of incidents requested, but instead, it lists all incidents - which can be in the 1,000s.
### Issue script & Debug output
```PowerShell
$SubscriptionId = 'abcde-12345-abcde-12345'
$ResourceGroupName = 'my-group'
$WorkspaceName = 'sentinelWS'
Import-Module Az.SecurityInsights
Connect-AzAccount
$Incidents = Get-AzSentinelIncident -SubscriptionId $SubscriptionId -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName -top 10
$Incidents.count
3,952
```
### Environment data
```PowerShell
$PSVersionTable
Name Value
---- -----
PSVersion 7.3.6
PSEdition Core
GitCommitId 7.3.6
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```
### Module versions
```PowerShell
Get-Module Az*
ModuleType Version PreRelease Name
---------- ------- ---------- ----
Script 2.13.0 Az.Accounts
Script 3.0.2 Az.SecurityInsights
```
### Error output
```PowerShell
There are no errors.
```
Contributor guide
Assessment
This issue has not been assessed yet.