Files
FFU/FFUDevelopment/Apps/Orchestration/Install-StoreApps.ps1
T
rbalsleyMSFT f162de89be - Added Apps\Orchestration folder with new orchestration workflow to replace InstallAppsAndSysprep.cmd file.
- Updated BuildFFUUnattend files to point to the new Orchestrator.ps1 file.
- Added new common and FFUUI.Core directories that house common/shared files between the UI and PS1 script. This breaks up each of the PS1 scripts to keep things smaller and more organized. Still a lot of work to do here to pull some stuff out of the PS1 scripts.
- Modified the CaptureFFU.ps1 file to include more info during the capture process to help with troubleshooting
- Too many functional changes to list here.
2025-05-26 11:54:14 -07:00

56 lines
2.1 KiB
PowerShell

$basePath = "D:\MSStore"
# Check if the base path exists
Write-Host "Installing Store Apps: Checking for $basePath"
if (-not (Test-Path -Path $basePath)) {
Write-Host "Installing Store Apps: $basePath does not exist."
exit
}
Write-Host "Installing Store Apps: $basePath exists, installing apps."
# Process each app folder in the base path
foreach ($appFolder in Get-ChildItem -Path $basePath -Directory) {
$folderPath = $appFolder.FullName
$dependenciesFolder = Join-Path -Path $folderPath -ChildPath "Dependencies"
# Find main package - exclude Dependencies folder items and xml/yaml files
$mainPackage = Get-ChildItem -Path $folderPath -File |
Where-Object {
$_.DirectoryName -ne $dependenciesFolder -and
$_.Extension -ne ".xml" -and
$_.Extension -ne ".yaml"
} | Select-Object -First 1
if ($mainPackage) {
# Build DISM command with main package
$dismParams = @(
"/Online"
"/Add-ProvisionedAppxPackage"
"/PackagePath:`"$($mainPackage.FullName)`""
"/Region:all"
"/StubPackageOption:installfull"
)
# Add dependency packages if they exist
if (Test-Path -Path $dependenciesFolder) {
$dependencies = Get-ChildItem -Path $dependenciesFolder -File
foreach ($dependency in $dependencies) {
$dismParams += "/DependencyPackagePath:`"$($dependency.FullName)`""
}
}
# Look for license file and add appropriate parameter
$licenseFile = Get-ChildItem -Path $folderPath -Filter "*.xml" -File | Select-Object -First 1
if ($licenseFile) {
$dismParams += "/LicensePath:`"$($licenseFile.FullName)`""
} else {
$dismParams += "/SkipLicense"
}
# Construct final command
$dismCommand = "DISM " + ($dismParams -join " ")
# Output and execute the command
Write-Output $dismCommand
Invoke-Expression -Command $dismCommand
}
}