# Create a custom object to hold the results
$results = "" | Select-Object `
Name, `
NumOfDays, `
NumOfCrashes, `
NumOfReboots, `
MinutesDown, `
MinutesUp, `
PercentDowntime, `
PercentUptime
$results.Name = $ComputerName
$results.NumOfDays = $NumberOfDays
$results.NumOfCrashes = $crashCounter
$results.NumOfReboots = $rebootCounter
$results.MinutesDown = "{0:n2}" -f $downtime.TotalMinutes
$results.MinutesUp = "{0:n2}" -f $uptime.TotalMinutes
$results.PercentDowntime = "{0:p4}" -f (1 - $uptime.TotalMinutes/$minutesInPeriod)
$results.PercentUptime = "{0:p4}" -f ($uptime.TotalMinutes/$minutesInPeriod)
Write-Output $results
# Kill our session to the remote computer
Remove-PSSession -Session $mySession
I believe this is causing the columns to look like the below: (without the spaces between each record - couldnt get this to format right for me in this)
Name : ServerName
NumOfDays : 8
NumOfCrashes : 0
NumOfReboots : 2
MinutesDown : 1.68
MinutesUp : 11,518.32
PercentDowntime : 0.0146 %
PercentUptime : 99.9854 %
Is there a way I can modify to be tab delimited on output? If I'm in the wrong place do you know of a good Powershell forum I could reach out to? Or do you know of a work around I could do with the current format so that I can build a package around it for data automation upload?