# Function to print-out messages, including <date> and <time> information. $scriptName = $MyInvocation.MyCommand.Name $logFile = "$env:ProgramData\Siemens\LMS\Logs\CleanUp.log" function Log-Message { [CmdletBinding()] Param ( [Parameter(Mandatory=$true, Position=0)] [string]$LogMessage ) $logEntry = "[$scriptName/$scriptVersion] $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - $LogMessage" Write-Output $logEntry Add-Content -Path $logFile -Value $logEntry -Encoding ASCII }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)