Hi,
I am trying to add a timestamp as an additional column to the below command:
Get-ClusterGroup | ? {$_.GroupType -eq 'VirtualMachine'} | Out-File -Append c:\test.txt
So far I can only get the timestamp at the beginning of each output:
function Get-Timestamp {
return "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date)
}
filter timestamp {"$(Get-Date -Format G): $_"}
$result = Get-ClusterGroup | ? {$_.GroupType -eq 'VirtualMachine'}
$result2 = $(Get-TimeStamp) |
Write-Output $result2 $result |Out-File -Append c:\"cluster_audit"\test.txt
What I would like is
Name OwnerNode State Timestamp
---------------------------------------------
Can anyone suggest anything?
Thanks in advance,
Matt