-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.ps1
More file actions
59 lines (48 loc) · 2.05 KB
/
launch.ps1
File metadata and controls
59 lines (48 loc) · 2.05 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Microsoft Graph Security Webhook Tester - Launch Script
# This script sets up the environment and launches the application
Write-Host "Microsoft Graph Security Webhook Tester" -ForegroundColor Green
Write-Host "=========================================" -ForegroundColor Green
# Check if Python is installed
try {
$pythonVersion = python --version 2>&1
Write-Host "Python found: $pythonVersion" -ForegroundColor Green
} catch {
Write-Host "Python not found. Please install Python 3.8+ from https://python.org" -ForegroundColor Red
pause
exit 1
}
# Get the directory where this script is located
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
Set-Location $scriptDir
Write-Host "Working directory: $scriptDir" -ForegroundColor Yellow
# Check if virtual environment exists
if (Test-Path ".venv") {
Write-Host "Virtual environment found" -ForegroundColor Green
} else {
Write-Host "Virtual environment not found. Creating one..." -ForegroundColor Yellow
python -m venv .venv
Write-Host "Virtual environment created" -ForegroundColor Green
}
# Activate virtual environment
Write-Host "Activating virtual environment..." -ForegroundColor Yellow
& ".venv\Scripts\Activate.ps1"
# Install/upgrade requirements
Write-Host "Installing/updating requirements..." -ForegroundColor Yellow
pip install -r requirements.txt
# Check if config file exists
if (Test-Path "config.json") {
Write-Host "Configuration file found" -ForegroundColor Green
} else {
Write-Host "Configuration file not found. Using template..." -ForegroundColor Yellow
Copy-Item "config_template.json" "config.json"
Write-Host "Please edit config.json with your Azure app registration details" -ForegroundColor Cyan
Write-Host "You can also configure it through the application GUI" -ForegroundColor Cyan
}
Write-Host ""
Write-Host "Launching Graph Security Webhook Tester..." -ForegroundColor Green
Write-Host ""
# Launch the application
python graph_security_webhook_tester.py
Write-Host ""
Write-Host "Application closed" -ForegroundColor Yellow
pause