Pipelines/Steps/Install/OnPrem/Sitecore/Install-SitecorePackages.ps1

$ErrorActionPreference = "Stop"

Write-Output "Install Sitecore packages started..."

$websiteRoot = $SAFConfiguration.sitecore.installDir
$websiteUrl = "https://$($SAFConfiguration.sitecore.hostNames[0])"

$packagesDir = "$(Get-Location)\SitecorePackages"
if (!(Test-Path $packagesDir)) {
    Write-Output "No Sitecore packages to install..."
}
else {
    $packages = Get-ChildItem $packagesDir
    foreach ($package in $packages) {
        $packagePath = $package.FullName
        InstallSitecorePackage -WebsiteRoot $websiteRoot -WebsiteUrl $websiteUrl -PackagePath $packagePath
    }
}

Write-Output "Install Sitecore packages done."