Azure / Azure/azure-powershell

Get-AzSentinelIncident "-top" switch does not work.

Open
#22,826 7 comments 0 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad bug customer-reported SecurityInsights Service Attention
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.