Skip to content

Commit

Permalink
Fix for Issue #134
Browse files Browse the repository at this point in the history
vCheck now always saves a copy of the report with embedded images - this is used for the attachment and $DisplayToScreen.

If $Outputpath is specified it is saved there, otherwise it will go to temp directory.
  • Loading branch information
Sneddo committed Mar 5, 2014
1 parent 915cc8b commit d3851b8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions vCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -542,18 +542,17 @@ else {
$Filename = $Env:TEMP + "\" + $Server + "vCheck" + "_" + $Date.Day + "-" + $Date.Month + "-" + $Date.Year + ".htm"
}

# Always generate the report with embedded images
$embedReport = $MyReport
# Loop over all CIDs and replace them
Foreach ($cid in $global:ReportResources.Keys) {
$embedReport = $embedReport -replace ("cid:{0}" -f $cid), (Get-ReportResource $cid -ReturnType "embed")
}
$embedReport | Out-File -encoding ASCII -filepath $Filename

# Display to screen
if ($DisplayToScreen) {
Write-CustomOut $lang.HTMLdisp
$tempReport = $MyReport
# Loop over all CIDs and replace them
Foreach ($cid in $global:ReportResources.Keys) {
$tempReport = $tempReport -replace ("cid:{0}" -f $cid), (Get-ReportResource $cid -ReturnType "embed")
}

# Create the file
$tempReport | Out-File -encoding ASCII -filepath $Filename

Write-CustomOut $lang.HTMLdisp
Invoke-Item $Filename
}

Expand Down

0 comments on commit d3851b8

Please sign in to comment.