-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config-Runner.ps1
42 lines (34 loc) · 1.29 KB
/
Config-Runner.ps1
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
# Define the path to the config.json file
$configFilePath = ".\config.json"
# Read the config.json file and convert it from JSON
if (Test-Path $configFilePath) {
$configContent = Get-Content $configFilePath -Raw | ConvertFrom-Json
} else {
Write-Error "Config file not found at path: $configFilePath"
exit
}
# Prepare the parameters for splatting
$params = @{}
# Dynamically add each property from the config file to the params hashtable
foreach ($property in $configContent.PSObject.Properties) {
$params[$property.Name] = $property.Value
}
# Run Gen-Sleepload.ps1 script with the parameters from the config file
.\Gen-Assload.ps1 @params
# Define the path to the config.json file
$configFilePath = ".\config.json"
# Read the config.json file and convert it from JSON
if (Test-Path $configFilePath) {
$configContent = Get-Content $configFilePath -Raw | ConvertFrom-Json
} else {
Write-Error "Config file not found at path: $configFilePath"
exit
}
# Prepare the parameters for splatting
$params = @{}
# Dynamically add each property from the config file to the params hashtable
foreach ($property in $configContent.PSObject.Properties) {
$params[$property.Name] = $property.Value
}
# Run Gen-Sleepload.ps1 script with the parameters from the config file
.\Gen-All.ps1 @params