Version 1.4
This commit is contained in:
@@ -1113,9 +1113,6 @@ function Close-Logging {
|
||||
# Enterprise Logging
|
||||
############################################################
|
||||
|
||||
$Script:LogDirectory = "C:\ProgramData\VeeamInstaller\Logs"
|
||||
|
||||
|
||||
|
||||
############################################################
|
||||
# Initialize-EnterpriseLog
|
||||
@@ -1123,53 +1120,41 @@ $Script:LogDirectory = "C:\ProgramData\VeeamInstaller\Logs"
|
||||
|
||||
function Initialize-EnterpriseLog {
|
||||
|
||||
|
||||
param(
|
||||
|
||||
[string]$Name = "VeeamInstall"
|
||||
|
||||
)
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($Script:LogDirectory)) {
|
||||
$Script:LogDirectory = "C:\ProgramData\VeeamInstaller\Logs"
|
||||
}
|
||||
|
||||
if(!(Test-Path $Script:LogDirectory))
|
||||
{
|
||||
|
||||
New-Item `
|
||||
-Path $Script:LogDirectory `
|
||||
-ItemType Directory `
|
||||
-Force |
|
||||
|
||||
Out-Null
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$Script:LogFile = Join-Path `
|
||||
$Script:LogDirectory `
|
||||
(
|
||||
-Path $Script:LogDirectory `
|
||||
-ChildPath (
|
||||
$Name +
|
||||
"_" +
|
||||
(
|
||||
Get-Date -Format "yyyyMMdd_HHmmss"
|
||||
) +
|
||||
(Get-Date -Format "yyyyMMdd_HHmmss") +
|
||||
".log"
|
||||
)
|
||||
|
||||
|
||||
|
||||
New-Item `
|
||||
-Path $Script:LogFile `
|
||||
-ItemType File `
|
||||
-Force |
|
||||
|
||||
Out-Null
|
||||
|
||||
|
||||
|
||||
return $Script:LogFile
|
||||
|
||||
}
|
||||
|
||||
############################################################
|
||||
# Write-EnterpriseLog
|
||||
############################################################
|
||||
|
||||
Reference in New Issue
Block a user