Created
December 22, 2015 08:54
-
-
Save tobyqin/d22f1998ef98834d3b6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LogDir($env) | |
{ | |
$dir = $globalConf.LogDir | |
New-Item -Path $dir -ItemType "Directory" -Force | Out-Null | |
return $dir | |
} | |
function Init-LogFile($env, $stepName) | |
{ | |
$logDir = Get-LogDir $env | |
$dateString = Get-Date -Format "yyyyMMdd_HHmmss" | |
$stepName = "{0}_{1}" -f $stepName, $dateString | |
$file = Join-Path "$logDir" "$stepName.log" | |
Log-Info "Log: $file" | |
New-Item -Path $file -ItemType "File" -Force | Out-Null | |
return $file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment