Change Date format in log header
parent
01dbee1a99
commit
6827c9afe2
|
@ -5,7 +5,7 @@ function Start-Init {
|
||||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||||
|
|
||||||
#Log Header
|
#Log Header
|
||||||
$Log = "`n##################################################`n# CHECK FOR APP UPDATES - $(Get-Date -Format 'dd/MM/yyyy')`n##################################################"
|
$Log = "`n##################################################`n# CHECK FOR APP UPDATES - $(Get-Date -Format (Get-culture).DateTimeFormat.ShortDatePattern)`n##################################################"
|
||||||
$Log | Write-host
|
$Log | Write-host
|
||||||
|
|
||||||
#Logs initialisation if admin
|
#Logs initialisation if admin
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
function Write-Log ($LogMsg,$LogColor = "White") {
|
function Write-Log ($LogMsg, $LogColor = "White") {
|
||||||
#Get log
|
#Get log
|
||||||
$Log = "$(Get-Date -UFormat "%T") - $LogMsg"
|
$Log = "$(Get-Date -UFormat "%T") - $LogMsg"
|
||||||
#Echo log
|
#Echo log
|
||||||
$Log | Write-host -ForegroundColor $LogColor
|
$Log | Write-host -ForegroundColor $LogColor
|
||||||
#Write log to file
|
#Write log to file
|
||||||
$Log | Out-File -filepath $LogFile -Append
|
$Log | Out-File -FilePath $LogFile -Append
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue