@@ -243,20 +243,26 @@ function CreateSiteExtensions() {
243243 if ($minorVersionPrefix -eq " " ) {
244244 ZipContent $siteExtensionPath " $zipOutput \Functions.$extensionVersion$runtimeSuffix .zip"
245245 } elseif ($minorVersionPrefix -eq " 8" ) {
246+ Write-Host " ======================================"
246247 # Only the "Functions" site extension supports hard links
247- Write-Host " Removing $hashesForHardLinksPath before zipping."
248+ Write-Host " MinorVersionPrefix is '8'. Removing $hashesForHardLinksPath before zipping."
248249 Remove-Item - Force " $hashesForHardLinksPath " - ErrorAction Stop
249250 # The .NET 8 host doesn't require any workers. Doing this to save space.
250251 Write-Host " Removing workers before zipping."
251- Remove-Item - Recurse - Force " $siteExtensionPath \$extensionVersion$runtimeSuffix \workers" - ErrorAction Stop
252- # The host requires that this folder exists, even if it's empty
253- New-Item - Itemtype directory - path $siteExtensionPath \$extensionVersion$runtimeSuffix \workers > $null
252+ # The host requires that this folder exists and it cannot be empty
253+ Remove-Item - Recurse - Force " $siteExtensionPath \$extensionVersion$runtimeSuffix \workers" - ErrorAction Stop
254+ New-Item - Path " $siteExtensionPath \$extensionVersion$runtimeSuffix " - Name " workers" - ItemType Directory - ErrorAction Stop | Out-Null
255+ Set-Content - Force - Path " $siteExtensionPath \$extensionVersion$runtimeSuffix \workers\this_folder_intentionally_empty.txt" - Value " .NET 8 builds do not have workers. However, this folder must contain at least one file." - ErrorAction Stop
256+ Write-Host " ======================================"
254257 Write-Host
255258 ZipContent $siteExtensionPath " $zipOutput \FunctionsInProc8.$extensionVersion$runtimeSuffix .zip"
256259 } elseif ($minorVersionPrefix -eq " 6" ) {
257260 # Only the "Functions" site extension supports hard links
258- Write-Host " Removing $hashesForHardLinksPath before zipping."
261+ Write-Host " ======================================"
262+ Write-Host " MinorVersionPrefix is '6'. Removing $hashesForHardLinksPath before zipping."
259263 Remove-Item - Force " $hashesForHardLinksPath " - ErrorAction Stop
264+ Write-Host " ======================================"
265+ Write-Host
260266 ZipContent $siteExtensionPath " $zipOutput \FunctionsInProc.$extensionVersion$runtimeSuffix .zip"
261267 }
262268
@@ -309,7 +315,7 @@ Write-Host
309315Write-Host " Output directory: $buildOutput "
310316if (Test-Path $buildOutput ) {
311317 Write-Host " Existing build output found. Deleting."
312- Remove-Item $buildOutput - Recurse - Force
318+ Remove-Item $buildOutput - Recurse - Force - ErrorAction Stop
313319}
314320Write-Host " Extensions version: $extensionVersion "
315321Write-Host " "
0 commit comments