Change Date format in log header

pull/35/head
Romain 2022-03-26 09:22:49 +01:00
parent 01dbee1a99
commit 6827c9afe2
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ function Start-Init {
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
#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
#Logs initialisation if admin

View File

@ -1,9 +1,9 @@
function Write-Log ($LogMsg,$LogColor = "White") {
function Write-Log ($LogMsg, $LogColor = "White") {
#Get log
$Log = "$(Get-Date -UFormat "%T") - $LogMsg"
#Echo log
$Log | Write-host -ForegroundColor $LogColor
#Write log to file
$Log | Out-File -filepath $LogFile -Append
$Log | Out-File -FilePath $LogFile -Append
}