notarat
2[H]4U
- Joined
- Mar 28, 2010
- Messages
- 2,501
So...
I have 3 variables
$rt = Date/Time a script is run
$a = Milliseconds to copy from local computer to remote computer
$b = Milliseconds to copy from remote computer to local computer
The write-host command (shown below) displays the info properly, like so (01/06/2015, 1.278789, 2.18896)
write-host $rt','$a','$b
I'm trying to output those values to either a text file or CSV file in that exact format but out-file either results in an error or exports each of the values on a separate line in the CSV or text file.
I tried combining them
$strCombined =$rt+$a+$b
but get the error about converting timespan to string
Okay...Let's convert each value to a string
$aa = ($a | Out-string)
$bb = ($b | Out-String)
$rtc = ($rt | Out-string)
Combining these converted values still results in each value being displayed on a separate line.
I know it's s stupid question and I'm overlooking something simple, but I'm fried and could use some assistance in getting these 3 values outputted to a text/csv in the following format:
01/06/2015, 1.278789, 2.18896
I have 3 variables
$rt = Date/Time a script is run
$a = Milliseconds to copy from local computer to remote computer
$b = Milliseconds to copy from remote computer to local computer
The write-host command (shown below) displays the info properly, like so (01/06/2015, 1.278789, 2.18896)
write-host $rt','$a','$b
I'm trying to output those values to either a text file or CSV file in that exact format but out-file either results in an error or exports each of the values on a separate line in the CSV or text file.
I tried combining them
$strCombined =$rt+$a+$b
but get the error about converting timespan to string
Okay...Let's convert each value to a string
$aa = ($a | Out-string)
$bb = ($b | Out-String)
$rtc = ($rt | Out-string)
Combining these converted values still results in each value being displayed on a separate line.
I know it's s stupid question and I'm overlooking something simple, but I'm fried and could use some assistance in getting these 3 values outputted to a text/csv in the following format:
01/06/2015, 1.278789, 2.18896