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