-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRunTest.ps1
More file actions
35 lines (31 loc) · 1.26 KB
/
RunTest.ps1
File metadata and controls
35 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#region Install required modules
if ( -not ( Get-Module -ListAvailable Az.Accounts ) ) {
Install-Module Az.Accounts -Force
}
#endregion
$workspaceName = "SentinelWorkspaceName"
$resourceGroup = "resourceGroup"
$subscriptionId = "SubscriptionId"
$configRunContainer = New-PesterContainer -Path "*.Tests.ps1" -Data @{
# Define your environment variables here
workspaceName = $workspaceName
resourceGroup = $resourceGroup
subscriptionId = $subscriptionId
}
Connect-AzAccount -DeviceCode
Set-AzContext -SubscriptionId $subscriptionId | Out-Null
$config = New-PesterConfiguration -Hashtable @{
Filter = @{
# Use the filter configuration to only specify the tests
# This way you can easily remove e.g. specific dataconnectors from the test without mofiying the test itself
# You will always have to modify the tests.ps1 file if you would like to remove specific tables it change the target configuration
Tag = "Configuration", "AnalyticsRules", "Watchlists", "AAD", "AADIPC", "AzureActivity", "DfC", "O365"
}
TestResult = @{ Enabled = $true }
Run = @{
Exit = $true
Container = $configRunContainer
}
Output = @{ Verbosity = 'Detailed' }
}
Invoke-Pester -Configuration $config