Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Source = "c:\temp\posilator_prod.bak"
- $Target = "c:\temp\posilator_prod.zip"
- if([System.IO.File]::Exists($Target)){
- Remove-item $Target
- }
- if([System.IO.File]::Exists($Source)){
- Remove-item $Source
- }
- Backup-SqlDatabase -ServerInstance . -Database posilator_prod -BackupAction Database -BackupFile 'c:\temp\posilator_prod.bak'
- if (-not (test-path "$env:ProgramFiles\7-Zip\7z.exe")) {throw "$env:ProgramFiles\7-Zip\7z.exe needed"}
- set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"
- sz a -mx=4 $Target $Source
- if([System.IO.File]::Exists($Source)){
- Remove-item $Source
- }
Add Comment
Please, Sign In to add comment