Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

out-file error

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-31-2008   #1 (permalink)
DaveG
Guest


 

out-file error

I am consistently getting an error when I try to use out-file:

PS M:\> get-process | out-file -filepath M:\process.txt
Out-File : Unknown error "-1".
At line:1 char:23
+ get-process | out-file <<<< -filepath M:\process.txt

I've tried different locations to save the file, even running the shell and
command as a Domain Admin - same error.

Tried uninstalling powershell, repairing the .Net framework and then
reinstalling PS, reboots, etc. - same error.

Running Windows XP SP2 on an IBM Thinkpad (T42)

Has anyone else experienced this?

My System SpecsSystem Spec
Old 01-31-2008   #2 (permalink)
Shay Levi
Guest


 

Re: out-file error


Can you try:

get-process > M:\process.txt


-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> I am consistently getting an error when I try to use out-file:
>
> PS M:\> get-process | out-file -filepath M:\process.txt
> Out-File : Unknown error "-1".
> At line:1 char:23
> + get-process | out-file <<<< -filepath M:\process.txt
> I've tried different locations to save the file, even running the
> shell and command as a Domain Admin - same error.
>
> Tried uninstalling powershell, repairing the .Net framework and then
> reinstalling PS, reboots, etc. - same error.
>
> Running Windows XP SP2 on an IBM Thinkpad (T42)
>
> Has anyone else experienced this?
>

My System SpecsSystem Spec
Old 01-31-2008   #3 (permalink)
DaveG
Guest


 

RE: out-file error

Let me add that I can do all of these functions from a regular command
prompt. (Create, copy, append, etc)

"DaveG" wrote:
Quote:

> I am consistently getting an error when I try to use out-file:
>
> PS M:\> get-process | out-file -filepath M:\process.txt
> Out-File : Unknown error "-1".
> At line:1 char:23
> + get-process | out-file <<<< -filepath M:\process.txt
>
> I've tried different locations to save the file, even running the shell and
> command as a Domain Admin - same error.
>
> Tried uninstalling powershell, repairing the .Net framework and then
> reinstalling PS, reboots, etc. - same error.
>
> Running Windows XP SP2 on an IBM Thinkpad (T42)
>
> Has anyone else experienced this?
My System SpecsSystem Spec
Old 02-02-2008   #4 (permalink)
Robert Aldwinckle
Guest


 

Re: out-file error

"DaveG" <DaveG@xxxxxx> wrote in message
news:C2053667-AA90-4563-AD87-9556F46EA62D@xxxxxx
Quote:

> I am consistently getting an error when I try to use out-file:
>
> PS M:\> get-process | out-file -filepath M:\process.txt
> Out-File : Unknown error "-1".
> At line:1 char:23
> + get-process | out-file <<<< -filepath M:\process.txt
>
Column 23 is where the switch starts. It doesn't like you specifying the switch?
What happens if you get prompted for the FilePath parameter?

FWIW it doesn't like getting a question mark (?) at that time either? <eg>

<PS_output Version="V2 (CTP)">
cmdlet out-file at command pipeline position 2
Supply values for the following parameters:
FilePath: ?
Out-File : Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
At line:1 char:23
+ get-process | out-file <<<< -v -d
</PS_output>

I noticed that out-file is seen as a "cmdlet" so I tried adding "commonparameters"
-verbose and -debug, evidently to no useful effect. Makes me wonder if that might be
a source of your symptom but I don't know how to check for it...


Have you tried capturing a trace of this with ProcMon?
E.g. that might expose an underlying permissions problem
on a registry or file access. (!) It could also show _me_
how out-file appears as a "cmdlet"...

Or not... It's mostly .NET stuff and I don't know how to trace it.


Good luck

Robert Aldwinckle
---

Quote:

> I've tried different locations to save the file, even running the shell and
> command as a Domain Admin - same error.
>
> Tried uninstalling powershell, repairing the .Net framework and then
> reinstalling PS, reboots, etc. - same error.
>
> Running Windows XP SP2 on an IBM Thinkpad (T42)
>
> Has anyone else experienced this?

My System SpecsSystem Spec
Old 02-02-2008   #5 (permalink)
Shay Levi
Guest


 

Re: out-file error

Good point Robert, this can shed some light on it.
Dave, can you run this and check for hints in the output:

trace-command -name OutFileCommand,ErrorDetails -expression { "test" | out-file
deleteMe.txt} -pshost

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> "DaveG" <DaveG@xxxxxx> wrote in message
> news:C2053667-AA90-4563-AD87-9556F46EA62D@xxxxxx
>
Quote:

>> I am consistently getting an error when I try to use out-file:
>>
>> PS M:\> get-process | out-file -filepath M:\process.txt
>> Out-File : Unknown error "-1".
>> At line:1 char:23
>> + get-process | out-file <<<< -filepath M:\process.txt
> Column 23 is where the switch starts. It doesn't like you specifying
> the switch? What happens if you get prompted for the FilePath
> parameter?
>
> FWIW it doesn't like getting a question mark (?) at that time either?
> <eg>
>
> <PS_output Version="V2 (CTP)">
> cmdlet out-file at command pipeline position 2
> Supply values for the following parameters:
> FilePath: ?
> Out-File : Index was out of range. Must be non-negative and less than
> the size of the collection.
> Parameter name: index
> At line:1 char:23
> + get-process | out-file <<<< -v -d
> </PS_output>
> I noticed that out-file is seen as a "cmdlet" so I tried adding
> "commonparameters" -verbose and -debug, evidently to no useful effect.
> Makes me wonder if that might be a source of your symptom but I don't
> know how to check for it...
>
> Have you tried capturing a trace of this with ProcMon?
> E.g. that might expose an underlying permissions problem
> on a registry or file access. (!) It could also show _me_
> how out-file appears as a "cmdlet"...
> Or not... It's mostly .NET stuff and I don't know how to trace it.
>
> Good luck
>
> Robert Aldwinckle
> ---
Quote:

>> I've tried different locations to save the file, even running the
>> shell and command as a Domain Admin - same error.
>>
>> Tried uninstalling powershell, repairing the .Net framework and then
>> reinstalling PS, reboots, etc. - same error.
>>
>> Running Windows XP SP2 on an IBM Thinkpad (T42)
>>
>> Has anyone else experienced this?
>>

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Message "File System Error (65535) Cindy Vista General 2 06-01-2008 06:43 PM
coping file from a remote file share - FILE IS NO LONG THERE bogus error message Heith Vista networking & sharing 0 10-18-2007 03:58 PM
Error 1325 - 'File name' is not a valid short file name. Bobby Fu Vista installation & setup 0 07-04-2007 12:35 AM
vista x64 RTM + Office 2007 = Error 1310.Error writing to file c:\ planetf1 Vista General 2 03-24-2007 05:53 AM
"Registration Error! Error during saving sugnature file! Larry Vista General 2 02-08-2007 03:11 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51