Skip to content

Instantly share code, notes, and snippets.

@OlafD
Last active March 26, 2019 11:20
Show Gist options
  • Save OlafD/8c9fb2eec7a46e7e0668c0559f4b9356 to your computer and use it in GitHub Desktop.
Save OlafD/8c9fb2eec7a46e7e0668c0559f4b9356 to your computer and use it in GitHub Desktop.
Create a zip-file for the deployment of a WebJob in an Azure Web Application. In the zip-file xml- and pdb-files are excluded.
param (
$Path,
$DestinationPath,
$ZipFile
)
Write-Host "Path: $Path"
Write-Host "DestinationPath: $DestinationPath"
Write-Host "ZipFile: $ZipFile"
If ((Test-Path $DestinationPath) -eq $false)
{
Write-Host "Create path $DestinationPath"
New-Item -ItemType Directory -Path $DestinationPath | Out-Null
}
cd $Path
$files = Get-ChildItem -Path . -Exclude "*.xml", "*.pdb" -Recurse
$files
Compress-Archive -Path $files -DestinationPath $DestinationPath\$ZipFile -CompressionLevel Optimal -Force
Write-Host -ForegroundColor Green "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment