-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.ps1
More file actions
40 lines (34 loc) · 1.85 KB
/
Copy pathMain.ps1
File metadata and controls
40 lines (34 loc) · 1.85 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
36
37
38
39
40
# Import component scripts
. '.\Scripts\DefenderExport-Core.ps1'
. '.\Scripts\DefenderExport-Queries.ps1'
. '.\Scripts\DefenderExport-Functions.ps1'
. '.\Scripts\DefenderExport-Main.ps1'
# Execution parameters
param(
[Parameter(Mandatory=$false)]
[string]$ConfigPath = ".\export-config.json",
[Parameter(Mandatory=$false)]
[string]$IocsFile,
[Parameter(Mandatory=$false)]
[switch]$ExportOnly
)
# Main execution
try {
# Initialize
Write-Host "Initializing..."
Initialize-ExportEnvironment
# Process IoCs if provided
if ($IocsFile) {
Write-Host "Processing IoCs from: $IocsFile"
Analyze-IoCs -CsvPath $IocsFile
}
# Run export
if (-not $ExportOnly) {
Write-Host "Running detection export..."
Start-DefenderExport -ConfigPath $ConfigPath
}
}
catch {
Write-Error "Execution failed: $_"
exit 1
}