Caveat: My Ignorance - apologies
I would like to write to a log file with a function: "Write-Log" e.g.
Write-Log -Message "moved file abcd.efd" -Path C:\MyLog.log
(Stolen from http://poshcode.org/2566)
I am successfully log writing, from an archiving script, with the Write-Log function, which I have added via a . include.
I would like to note to my log file, via Write-Log, which files have been archived.
Current archive details are:
Get-ChildItem -Path $SourceDir |
Where-Object {$_.LastWriteTime.Date -lt (get-date).AddDays(-$Age) -and -not $_.PSIsContainer} |
Move-Item -Destination $MoveDir
How may I plug in my Write-Log to record those files I have archived?
Thanks