Skip to content

Commit 7904f59

Browse files
author
dicolanl
committed
Revert "tests....."
This reverts commit 4dddc6c.
1 parent 4dddc6c commit 7904f59

File tree

9 files changed

+34
-47
lines changed

9 files changed

+34
-47
lines changed

src/Dns/Dns.sln

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 16
3-
VisualStudioVersion = 16.0.30709.132
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.27703.2042
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dns", "Dns\Dns.csproj", "{3CAE1B57-FFEC-4945-A6C5-6E5E8DEA4BA9}"
66
EndProject
@@ -40,10 +40,6 @@ Global
4040
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
4141
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
4242
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
43-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU
45-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU
46-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU
4743
{98CFD96B-A6BC-4F15-AE2C-603FC2B58981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4844
{98CFD96B-A6BC-4F15-AE2C-603FC2B58981}.Debug|Any CPU.Build.0 = Debug|Any CPU
4945
{98CFD96B-A6BC-4F15-AE2C-603FC2B58981}.Release|Any CPU.ActiveCfg = Release|Any CPU

src/Media/Media.sln

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
12
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 16
3-
VisualStudioVersion = 16.0.30709.132
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27703.2042
45
MinimumVisualStudioVersion = 10.0.40219.1
56
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Media", "Media\Media.csproj", "{A505E64B-6AA8-43AC-90E7-22A94FD38A0F}"
67
EndProject
@@ -38,10 +39,6 @@ Global
3839
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
3940
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
4041
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
41-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU
4542
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4643
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
4744
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Release|Any CPU.ActiveCfg = Release|Any CPU

src/SecurityInsights/SecurityInsights.Test/ScenarioTests/ActionsTests.ps1 renamed to src/SecurityInsights/SecurityInsights.Test/ScenarioTests/Actions/ActionsTests.ps1

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@
1616
.SYNOPSIS
1717
List Actions by Alert Rule
1818
#>
19-
function Get-AzSentinelAlertRuleAction-ListByAlertRule
19+
function Get-AzSentineAlertRulelAction-ListByAlertRule
2020
{
2121

2222
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
23-
$TriggerUri = Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName (Get-TestResourceGroupName) -Name "Block-AADUser" -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered"
2423
$LogicAppResourceId2 = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Get-MDATPInvestigationPackage"
25-
$TriggerUri2 = Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName (Get-TestResourceGroupName) -Name "Get-MDATPInvestigationPackage" -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered"
2624

2725
#Create Alert Rule
28-
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Kind Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuppressionDuration (New-TimeSpan -Hours 5) -SuppressionEnabled $false -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
26+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Type Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuprressionDuration "PT5H" -SuprressionEnabled $false
2927
#Create Alert Rule Action
30-
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId -TriggerUri ($TriggerUri.value)
28+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -LogicAppResourceId $LogicAppResourceId
3129
#Create Alert Rule Action
32-
$action2 = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId2 -TriggerUri ($TriggerUri2.value)
30+
$action2 = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -LogicAppResourceId $LogicAppResourceId2
3331

3432
#Get Alert Rule Actions
3533
$actions = Get-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name)
@@ -48,12 +46,11 @@ function Get-AzSentinelAlertRuleAction-GetAction
4846
{
4947

5048
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
51-
$TriggerUri = Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName (Get-TestResourceGroupName) -Name "Block-AADUser" -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered"
5249

5350
#Create Alert Rule
54-
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Kind Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuppressionDuration (New-TimeSpan -Hours 5) -SuppressionEnabled $false -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
51+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Type Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuprressionDuration "PT5H" -SuprressionEnabled $false
5552
#Create Alert Rule Action
56-
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId -TriggerUri ($TriggerUri.value)
53+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -LogicAppResourceId $LogicAppResourceId
5754

5855
#Get Alert Rule Action
5956
$action = Get-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -ActionId ($action.Name)
@@ -71,12 +68,11 @@ Create Action
7168
function New-AzSentinelAlertRuleAction-Create
7269
{
7370
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
74-
$TriggerUri = Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName (Get-TestResourceGroupName) -Name "Block-AADUser" -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered"
7571

7672
#Create Alert Rule
77-
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Kind Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuppressionDuration (New-TimeSpan -Hours 5) -SuppressionEnabled $false -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
73+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Type Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuprressionDuration "PT5H" -SuprressionEnabled $false
7874
#Create Alert Rule Action
79-
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId -TriggerUri ($TriggerUri.value)
75+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -LogicAppResourceId $LogicAppResourceId
8076

8177
#Validate
8278
Validate-Action $action
@@ -92,17 +88,15 @@ Update Action
9288
function Set-AzSentinelAlertRuleAction-Update
9389
{
9490
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
95-
$TriggerUri = Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName (Get-TestResourceGroupName) -Name "Block-AADUser" -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered"
9691
$LogicAppResourceId2 = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Get-MDATPInvestigationPackage"
97-
$TriggerUri2 = Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName (Get-TestResourceGroupName) -Name "Get-MDATPInvestigationPackage" -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered"
9892

9993
#Create Alert Rule
100-
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Kind Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuppressionDuration (New-TimeSpan -Hours 5) -SuppressionEnabled $false -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
94+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Type Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuprressionDuration "PT5H" -SuprressionEnabled $false
10195
#Create Alert Rule Action
102-
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId -TriggerUri ($TriggerUri.value)
96+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -LogicAppResourceId $LogicAppResourceId
10397

10498
#update action
105-
$action = Set=AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId2 -TriggerUri ($TriggerUri2.value)
99+
$action = Set=AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -LogicAppResourceId $LogicAppResourceId2
106100

107101
# Validate
108102
Validate-Action $action
@@ -118,13 +112,11 @@ Delete Action
118112
function Remove-AzSentinelAlertRuleAction-Delete
119113
{
120114
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
121-
$TriggerUri = Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName (Get-TestResourceGroupName) -Name "Block-AADUser" -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered"
122115

123116
#Create Alert Rule
124-
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Kind Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuppressionDuration (New-TimeSpan -Hours 5) -SuppressionEnabled $false -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
117+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -Type Scheduled -Enabled $true -DisplayName "PoshModuleTest" -SuprressionDuration "PT5H" -SuprressionEnabled $false
125118
#Create Alert Rule Action
126-
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId -TriggerUri ($TriggerUri.value)
127-
#delete
119+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -LogicAppResourceId $LogicAppResourceId
128120
Remove-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -ActionId ($action.Name)
129121
# Validate
130122
Validate-Action $action

src/SecurityInsights/SecurityInsights.Test/ScenarioTests/TestController.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public void RunPowerShellTest(ServiceManagement.Common.Models.XunitTracingInterc
4646
var mockName = sf.GetMethod().Name;
4747

4848
_helper.TracingInterceptor = logger;
49-
5049
var providers = new Dictionary<string, string>();
5150
var providersToIgnore = new Dictionary<string, string>();
5251
HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, providers, providersToIgnore);
@@ -62,11 +61,10 @@ public void RunPowerShellTest(ServiceManagement.Common.Models.XunitTracingInterc
6261
_helper.SetupModules(
6362
AzureModule.AzureResourceManager,
6463
_helper.RMProfileModule,
65-
_helper.GetRMModulePath(@"AzureRM.LogicApp.psd1"),
66-
_helper.GetRMModulePath(@"AzureRM.Resources.psd1"),
6764
_helper.GetRMModulePath(@"AzureRM.SecurityInsights.psd1"),
6865
"ScenarioTests\\Common.ps1",
6966
"ScenarioTests\\" + callingClassName + ".ps1",
67+
"AzureRM.Storage.ps1",
7068
"AzureRM.Resources.ps1");
7169

7270
_helper.RunPowerShellTest(scripts);
@@ -77,7 +75,8 @@ protected void SetupManagementClients(MockContext context)
7775
{
7876
var resourcesClient = GetResourcesClient(context);
7977
var securityInsightsClient = GetSecurityInsightsClient(context);
80-
_helper.SetupManagementClients(securityInsightsClient, resourcesClient);
78+
var storageClient = GetStorageManagementClient(context);
79+
_helper.SetupManagementClients(securityInsightsClient, resourcesClient, storageClient);
8180
}
8281

8382
private static SecurityInsightsClient GetSecurityInsightsClient(MockContext context)
@@ -88,5 +87,9 @@ private static ResourceManagementClient GetResourcesClient(MockContext context)
8887
{
8988
return context.GetServiceClient<ResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
9089
}
90+
private static StorageManagementClient GetStorageManagementClient(MockContext context)
91+
{
92+
return context.GetServiceClient<StorageManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
93+
}
9194
}
9295
}

src/SecurityInsights/SecurityInsights.Test/SecurityInsights.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<None Update="ScenarioTests\ActionsTests.ps1">
24+
<None Update="ScenarioTests\Actions\ActionsTests.ps1">
2525
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2626
</None>
2727
</ItemGroup>

src/SecurityInsights/SecurityInsights/Cmdlets/Actions/NewAlertRuleActions.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using System;
2222
using Microsoft.Azure.Management.SecurityInsights.Models;
2323
using Microsoft.Azure.Commands.SecurityInsights.Models.Actions;
24-
using Microsoft.Azure.Management.SecurityInsights;
2524

2625
namespace Microsoft.Azure.Commands.SecurityInsights.Cmdlets.Actions
2726
{
@@ -40,14 +39,14 @@ public class NewAlertRuleActions : SecurityInsightsCmdletBase
4039
[Parameter(ParameterSetName = ParameterSetNames.ActionId, Mandatory = true, HelpMessage = ParameterHelpMessages.AlertRuleId)]
4140
public string AlertRuleId { get; set; }
4241

43-
[Parameter(ParameterSetName = ParameterSetNames.ActionId, Mandatory = false, HelpMessage = ParameterHelpMessages.ActionId)]
42+
[Parameter(ParameterSetName = ParameterSetNames.ActionId, Mandatory = true, HelpMessage = ParameterHelpMessages.ActionId)]
4443
public string ActionId { get; set; }
4544

4645
[Parameter(ParameterSetName = ParameterSetNames.ActionId, Mandatory = true, HelpMessage = ParameterHelpMessages.LogicAppResourceId)]
4746
[ValidateNotNullOrEmpty]
4847
public string LogicAppResourceId { get; set; }
4948

50-
[Parameter(ParameterSetName = ParameterSetNames.ActionId, Mandatory = true, HelpMessage = ParameterHelpMessages.TriggerUri)]
49+
[Parameter(ParameterSetName = ParameterSetNames.ActionId, Mandatory = false, HelpMessage = ParameterHelpMessages.TriggerUri)]
5150
public string TriggerUri { get; set; }
5251

5352
public override void ExecuteCmdlet()
@@ -67,7 +66,7 @@ public override void ExecuteCmdlet()
6766

6867
if (ShouldProcess(name, VerbsCommon.New))
6968
{
70-
var outputaction = SecurityInsightsClient.AlertRules.CreateOrUpdateAction(ResourceGroupName, WorkspaceName, AlertRuleId, name, action);
69+
var outputaction = SecurityInsightsClient.AlertRules.CreateOrUpdateActionWithHttpMessagesAsync(ResourceGroupName, WorkspaceName, AlertRuleId, name, action).GetAwaiter().GetResult().Body;
7170

7271
WriteObject(outputaction.ConvertToPSType(), enumerateCollection: false);
7372
}

src/SecurityInsights/SecurityInsights/Cmdlets/AlertRules/NewAlertRules.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,19 @@ public class NewAlertRules : SecurityInsightsCmdletBase
9999
[ValidateNotNullOrEmpty]
100100
public bool SuppressionEnabled { get; set; }
101101

102-
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = true, HelpMessage = ParameterHelpMessages.Query)]
102+
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = false, HelpMessage = ParameterHelpMessages.Query)]
103103
[ValidateNotNullOrEmpty]
104104
public string Query { get; set; }
105105

106-
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = true, HelpMessage = ParameterHelpMessages.QueryFrequency)]
106+
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = false, HelpMessage = ParameterHelpMessages.QueryFrequency)]
107107
[ValidateNotNullOrEmpty]
108108
public TimeSpan? QueryFrequency { get; set; }
109109

110-
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = true, HelpMessage = ParameterHelpMessages.QueryPeriod)]
110+
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = false, HelpMessage = ParameterHelpMessages.QueryPeriod)]
111111
[ValidateNotNullOrEmpty]
112112
public TimeSpan? QueryPeriod { get; set; }
113113

114-
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = true, HelpMessage = ParameterHelpMessages.Severity)]
114+
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = false, HelpMessage = ParameterHelpMessages.Severity)]
115115
[ValidateSet("High", "Informational", "Low", "Medium")]
116116
[ValidateNotNullOrEmpty]
117117
public string Severity { get; set; }
@@ -125,7 +125,7 @@ public class NewAlertRules : SecurityInsightsCmdletBase
125125
[ValidateNotNullOrEmpty]
126126
public TriggerOperator TriggerOperator { get; set; }
127127

128-
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = true, HelpMessage = ParameterHelpMessages.TriggerThreshold)]
128+
[Parameter(ParameterSetName = ParameterSetNames.ScheduledAlertRule, Mandatory = false, HelpMessage = ParameterHelpMessages.TriggerThreshold)]
129129
[ValidateNotNullOrEmpty]
130130
public int? TriggerThreshold { get; set; }
131131

tools/PS-VSPrompt.lnk

68 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)