Skip to content

Commit

Permalink
Merge pull request #91 from akunzai/feature/default-optimal
Browse files Browse the repository at this point in the history
The default CompressionLevel was Optimal
  • Loading branch information
akunzai authored Apr 19, 2023
2 parents 2bf0d8a + 0ab2ca0 commit 3f1dcae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/SecureAuditor-SendGrid.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if ($UseSmtp) {
if ($null -ne $attachmentPath -and (Test-Path -Path $attachmentPath -ErrorAction SilentlyContinue)) {
$filename = [IO.Path]::GetFileName($attachmentPath)
$zipPath = [IO.Path]::Combine([System.IO.Path]::GetTempPath(), ("{0}.zip" -f $filename))
Compress-Archive -LiteralPath $attachmentPath -DestinationPath $zipPath -CompressionLevel Optimal -Force
Compress-Archive -LiteralPath $attachmentPath -DestinationPath $zipPath -Force
$parameters.Add('Attachments', $zipPath)
}
Send-MailMessage @parameters
Expand Down Expand Up @@ -99,7 +99,7 @@ if ($UseSandbox) {
if ($null -ne $attachmentPath -and (Test-Path -Path $attachmentPath -ErrorAction SilentlyContinue)) {
$filename = [IO.Path]::GetFileName($attachmentPath)
$zipPath = ("{0}.zip" -f [System.IO.Path]::GetTempFileName())
Compress-Archive -LiteralPath $attachmentPath -DestinationPath $zipPath -CompressionLevel Optimal -Force
Compress-Archive -LiteralPath $attachmentPath -DestinationPath $zipPath -Force
# https://github.com/PowerShell/PowerShell/issues/14537
$bytes = if ($PSVersionTable.PSEdition -eq 'Core') {
Get-Content -Path $zipPath -AsByteStream
Expand Down
2 changes: 1 addition & 1 deletion examples/SecureAuditor-SendMail.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if ([bool]$config.FileIntegrityMonitoring.Enabled) {
if ($null -ne $attachmentPath -and (Test-Path -Path $attachmentPath -ErrorAction SilentlyContinue)) {
$filename = [IO.Path]::GetFileName($attachmentPath)
$zipPath = [IO.Path]::Combine([System.IO.Path]::GetTempPath(), ("{0}.zip" -f $filename))
Compress-Archive -LiteralPath $attachmentPath -DestinationPath $zipPath -CompressionLevel Optimal -Force
Compress-Archive -LiteralPath $attachmentPath -DestinationPath $zipPath -Force
$parameters.Add('Attachments', $zipPath)
}
Send-MailMessage @parameters

0 comments on commit 3f1dcae

Please sign in to comment.