![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Writing to a file with out-file or export-csv OK, pretty basic probably. Yes, I'm new to PSH, like us all! ;-) Why doesn't this work? PS C:\> gc test.1 1 2 PS C:\> for ($i=0;$i -lt $string.count;$i+=1) {$string[$i]} 1 2 PS C:\> for ($i=0;$i -lt $string.count;$i+=1) {$string[$i]}|out-file test.2 An empty pipe element is not permitted. At line:1 char:53 + for ($i=0;$i -lt $string.count;$i+=1) {$string[$i]}|o <<<< ut-file test.2 |
| | #2 (permalink) |
| Guest | RE: Writing to a file with out-file or export-csv I think this has been discussed not long ago somewhere here. Afaik it was just a design decision. Try this: $( for ($i=0;$i -lt $string.count;$i+=1) {$string[$i]} ) | out-file test.2 -- greetings dreeschkind "Marco Shaw" wrote: > OK, pretty basic probably. Yes, I'm new to PSH, like us all! ;-) > > Why doesn't this work? > > PS C:\> gc test.1 > 1 > 2 > PS C:\> for ($i=0;$i -lt $string.count;$i+=1) {$string[$i]} > 1 > 2 > PS C:\> for ($i=0;$i -lt $string.count;$i+=1) {$string[$i]}|out-file test.2 > An empty pipe element is not permitted. > At line:1 char:53 > + for ($i=0;$i -lt $string.count;$i+=1) {$string[$i]}|o <<<< ut-file test.2 > > > |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| writing out to file | Braden C. Roberson-Mailloux | PowerShell | 3 | 05-18-2008 01:12 PM |
| Re: Writing output to a formatted file | Keith Hill [MVP] | PowerShell | 0 | 11-08-2007 08:49 PM |
| out-file not writing ERROR's and WARNING's into the log | ThorstenK | PowerShell | 9 | 08-13-2007 07:23 PM |
| Newbie - Writing to host and a text file | FreddieF | PowerShell | 5 | 02-16-2007 11:03 AM |
| writing output to XML file | Nikhil R. Bhandari | PowerShell | 0 | 02-15-2007 07:40 AM |