$Today = Get-Date -Format 'yyyyMMdd' # Append AV program name(s) and timestamp(s) to log file $AV1 = ( Get-WmiObject -Class AntiVirusProduct -Namespace 'root\SecurityCenter2' ) $AV2 = ( $AV1 | Format-Table -Property displayName,timestamp ) $AV2 | Out-File -FilePath "\\Server\Logs\$Today\$Env:UserName.log" -Encoding ASCII -Append # The 3 lines above may be joined into a single line