-
Notifications
You must be signed in to change notification settings - Fork 3
/
runall.ps1
31 lines (24 loc) · 893 Bytes
/
runall.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
param (
$Path
)
If (!$Path) {
Write-Host "To execute all .PS1 scripts in a directory with recursion, simply drag & drop `nthe directory on the +RUN ALL SCRIPTS shortcut. Feel free to copy the shortcut `nto any convenient location."
}
Else {
# Load & configure hqTestLite.
Invoke-Expression "$(Get-ItemPropertyValue -Path "HKCU:\Software\HexisData\hqTestLite" -Name "ModuleDir")\config.ps1"
$GlobalNoInput = $NoInput
$NoInput = $true
# Run all scripts in child directories.
$result = @()
Get-Files -Path $Path -Include "\.ps1" | foreach {
$FilePath = $_
"Running " + $FilePath | Out-Host
$parent = Split-Path -Path $FilePath -Parent
Set-Location -Path $parent
$result += (& $FilePath)
}
$NoInput = $GlobalNoInput
Write-Host "All scripts executed!"
}
[void](Read-Host "`nPress Enter to continue")