Skip to content

Commit

Permalink
Archive evtx file to preserve display information
Browse files Browse the repository at this point in the history
  • Loading branch information
mtaanquist committed Jul 8, 2022
1 parent a0c9696 commit 54194d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ContainerInfo/Get-NavContainerEventLog.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.Synopsis
Get the Event log from a NAV/BC Container as an .evtx file
.Description
Expand Down Expand Up @@ -32,10 +32,12 @@ try {
New-Item $eventLogFolder -ItemType Directory | Out-Null
}
$eventLogName = Join-Path $eventLogFolder ($containerName + ' ' + [DateTime]::Now.ToString("yyyy-MM-dd HH.mm.ss") + ".evtx")
$locale = (Get-WinSystemLocale).Name

Invoke-ScriptInBcContainer -containerName $containerName -ScriptBlock { Param([string]$path, [string]$logname)
Invoke-ScriptInBcContainer -containerName $containerName -ScriptBlock { Param([string]$path, [string]$logname, [string]$locale)
wevtutil epl $logname "$path"
} -ArgumentList (Get-BcContainerPath -containerName $containerName -Path $eventLogName), $logname
wevtutil al "$path" /locale:$locale
} -ArgumentList (Get-BcContainerPath -containerName $containerName -Path $eventLogName), $logname, $locale

if ($doNotOpen) {
$eventLogName
Expand Down

0 comments on commit 54194d1

Please sign in to comment.