Improves application orchestration and BYO app handling

Enhances the orchestrator script to skip application installation steps if no corresponding app lists or files are present. This prevents unnecessary script executions and cleans up the output log.

Makes the 'Arguments' field optional when adding a 'Bring Your Own' application, simplifying the process for apps without arguments.

Ensures the 'Priority' field for applications is consistently saved as an integer to improve data integrity.
This commit is contained in:
rbalsleyMSFT
2025-07-17 16:50:38 -07:00
parent 56c811ad89
commit 62b4816498
3 changed files with 29 additions and 8 deletions
@@ -39,10 +39,31 @@ $scriptList = @(
"Install-StoreApps.ps1",
"Install-UserApps.ps1"
)
# Check if each script exists and run it if it does
# Check if each script exists and has content to process, then run it
foreach ($script in $scriptList) {
$scriptFile = Join-Path -Path $scriptPath -ChildPath $script
if (Test-Path -Path $scriptFile) {
if (-not (Test-Path -Path $scriptFile)) {
continue
}
$shouldRun = $true # Default to run if script exists
switch ($script) {
"Install-Win32Apps.ps1" {
$wingetAppsJsonFile = Join-Path -Path $scriptPath -ChildPath "WinGetWin32Apps.json"
$userAppsJsonFile = Join-Path -Path (Split-Path -Parent $scriptPath) -ChildPath "UserAppList.json"
if (-not (Test-Path -Path $wingetAppsJsonFile) -and -not (Test-Path -Path $userAppsJsonFile)) {
$shouldRun = $false
}
}
"Install-StoreApps.ps1" {
$msStorePath = "D:\MSStore"
if (-not (Test-Path -Path $msStorePath) -or -not (Get-ChildItem -Path $msStorePath)) {
$shouldRun = $false
}
}
}
if ($shouldRun) {
Write-Host "`n" # Add a newline for spacing
Write-Host "---------------------------------------------------" -ForegroundColor Yellow
Write-Host " Running script: $script " -ForegroundColor Yellow