Last active
March 26, 2019 11:20
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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