Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Out-File: Unknown error "-1".

Reply
 
Old 03-27-2008   #1 (permalink)
Evjan


 
 

Out-File: Unknown error "-1".

Whenever I try to create or copy a file I get the error as below on my XP SP2
machine. I've reinstalled PowerShell but that didn't help, and none of the
other forums questions that I've found through google seem to have an answer
why this happens.

Error message:
PS C:\> Get-Process | Out-File -FilePath c:\test.txt
Out-File : Unknown error "-1".
At line:1 char:23
+ Get-Process | Out-File <<<< -FilePath c:\test.txt

Does anyone have any ideas what to do?

My System SpecsSystem Spec
Old 03-27-2008   #2 (permalink)
Shay Levi


 
 

Re: Out-File: Unknown error "-1".


What OS? Can you out-file to any other location?

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

> Whenever I try to create or copy a file I get the error as below on my
> XP SP2 machine. I've reinstalled PowerShell but that didn't help, and
> none of the other forums questions that I've found through google seem
> to have an answer why this happens.
>
> Error message:
> PS C:\> Get-Process | Out-File -FilePath c:\test.txt
> Out-File : Unknown error "-1".
> At line:1 char:23
> + Get-Process | Out-File <<<< -FilePath c:\test.txt
> Does anyone have any ideas what to do?
>

My System SpecsSystem Spec
Old 03-27-2008   #3 (permalink)
Evjan


 
 

Re: Out-File: Unknown error "-1".

I'm using XP with SP2, and I'm the administrator. I can't out-file to any
other location that I've tried, for example my documents folder. And I can't
copy-item to them either.

"Shay Levi" wrote:
Quote:

>
> What OS? Can you out-file to any other location?
>
> -----
> Shay Levi
> $cript Fanatic
> http://scriptolog.blogspot.com
>
Quote:

> > Whenever I try to create or copy a file I get the error as below on my
> > XP SP2 machine. I've reinstalled PowerShell but that didn't help, and
> > none of the other forums questions that I've found through google seem
> > to have an answer why this happens.
> >
> > Error message:
> > PS C:\> Get-Process | Out-File -FilePath c:\test.txt
> > Out-File : Unknown error "-1".
> > At line:1 char:23
> > + Get-Process | Out-File <<<< -FilePath c:\test.txt
> > Does anyone have any ideas what to do?
> >
>
>
>
My System SpecsSystem Spec
Old 03-27-2008   #4 (permalink)
Shay Levi


 
 

Re: Out-File: Unknown error "-1".


I remember an old post on the same issue, I wasn't able to find a solution
If you want to take a look at it, search this NG for a post with a subject
line of "out-file error", by DaveG, 01/31/2008.
maybe someone else can contribute here.


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

> I'm using XP with SP2, and I'm the administrator. I can't out-file to
> any other location that I've tried, for example my documents folder.
> And I can't copy-item to them either.
>
> "Shay Levi" wrote:
>
Quote:

>> What OS? Can you out-file to any other location?
>>
>> -----
>> Shay Levi
>> $cript Fanatic
>> http://scriptolog.blogspot.com
Quote:

>>> Whenever I try to create or copy a file I get the error as below on
>>> my XP SP2 machine. I've reinstalled PowerShell but that didn't help,
>>> and none of the other forums questions that I've found through
>>> google seem to have an answer why this happens.
>>>
>>> Error message:
>>> PS C:\> Get-Process | Out-File -FilePath c:\test.txt
>>> Out-File : Unknown error "-1".
>>> At line:1 char:23
>>> + Get-Process | Out-File <<<< -FilePath c:\test.txt
>>> Does anyone have any ideas what to do?

My System SpecsSystem Spec
Old 03-27-2008   #5 (permalink)
Marco Shaw [MVP]


 
 

Re: Out-File: Unknown error "-1".

Evjan wrote:
Quote:

> Whenever I try to create or copy a file I get the error as below on my XP SP2
> machine. I've reinstalled PowerShell but that didn't help, and none of the
> other forums questions that I've found through google seem to have an answer
> why this happens.
>
> Error message:
> PS C:\> Get-Process | Out-File -FilePath c:\test.txt
> Out-File : Unknown error "-1".
> At line:1 char:23
> + Get-Process | Out-File <<<< -FilePath c:\test.txt
>
> Does anyone have any ideas what to do?
Can you try writing to a subdirectory?

The error isn't shown here, but it does mention that PowerShell can have
problems accessing the root of a drive on some systems:
http://support.microsoft.com/default.aspx/kb/941660

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 03-27-2008   #6 (permalink)
RichS


 
 

Re: Out-File: Unknown error "-1".

Have you tried using the -Force parameter on out-file ??
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Marco Shaw [MVP]" wrote:
Quote:

> Evjan wrote:
Quote:

> > Whenever I try to create or copy a file I get the error as below on my XP SP2
> > machine. I've reinstalled PowerShell but that didn't help, and none of the
> > other forums questions that I've found through google seem to have an answer
> > why this happens.
> >
> > Error message:
> > PS C:\> Get-Process | Out-File -FilePath c:\test.txt
> > Out-File : Unknown error "-1".
> > At line:1 char:23
> > + Get-Process | Out-File <<<< -FilePath c:\test.txt
> >
> > Does anyone have any ideas what to do?
>
> Can you try writing to a subdirectory?
>
> The error isn't shown here, but it does mention that PowerShell can have
> problems accessing the root of a drive on some systems:
> http://support.microsoft.com/default.aspx/kb/941660
>
> Marco
>
> --
> Microsoft MVP - Windows PowerShell
> http://www.microsoft.com/mvp
>
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com
>
My System SpecsSystem Spec
Old 04-15-2008   #7 (permalink)
Evjan


 
 

Re: Out-File: Unknown error "-1".

Marco: Yes, I've tried plenty of folders, including my home folder. Still the
same error.

Richard: I tried the -Force parameter, and that didn't help either I'm afraid.

Thanks for the tips both of you though. Any other ones?

"RichS" wrote:
Quote:

> Have you tried using the -Force parameter on out-file ??
> --
> Richard Siddaway
> Please note that all scripts are supplied "as is" and with no warranty
> Blog: http://richardsiddaway.spaces.live.com/
> PowerShell User Group: http://www.get-psuguk.org.uk
>
>
> "Marco Shaw [MVP]" wrote:
>
Quote:

> > Evjan wrote:
Quote:

> > > Whenever I try to create or copy a file I get the error as below on my XP SP2
> > > machine. I've reinstalled PowerShell but that didn't help, and none of the
> > > other forums questions that I've found through google seem to have an answer
> > > why this happens.
> > >
> > > Error message:
> > > PS C:\> Get-Process | Out-File -FilePath c:\test.txt
> > > Out-File : Unknown error "-1".
> > > At line:1 char:23
> > > + Get-Process | Out-File <<<< -FilePath c:\test.txt
> > >
> > > Does anyone have any ideas what to do?
> >
> > Can you try writing to a subdirectory?
> >
> > The error isn't shown here, but it does mention that PowerShell can have
> > problems accessing the root of a drive on some systems:
> > http://support.microsoft.com/default.aspx/kb/941660
> >
> > Marco
> >
> > --
> > Microsoft MVP - Windows PowerShell
> > http://www.microsoft.com/mvp
> >
> > PowerGadgets MVP
> > http://www.powergadgets.com/mvp
> >
> > Blog:
> > http://marcoshaw.blogspot.com
> >
My System SpecsSystem Spec
Old 04-15-2008   #8 (permalink)
Marco Shaw [MVP]


 
 

Re: Out-File: Unknown error "-1".

Evjan wrote:
Quote:

> Marco: Yes, I've tried plenty of folders, including my home folder. Still the
> same error.
>
> Richard: I tried the -Force parameter, and that didn't help either I'm afraid.
>
> Thanks for the tips both of you though. Any other ones?
Do set-content or add-content work?

Not really hading towards a fix just yet, but I don't know how long we
can troubleshoot this particular system. It is not a common problem any
of us have seen.

Marco
My System SpecsSystem Spec
Old 04-16-2008   #9 (permalink)
Evjan


 
 

Re: Out-File: Unknown error "-1".

Hello Marco,

Thanks for the tip. I got the same error using set-content and add-content
on a ordinary .txt-file. I guess I have to continue using cygwin instead

// Peter


"Marco Shaw [MVP]" wrote:
Quote:

> Evjan wrote:
Quote:

> > Marco: Yes, I've tried plenty of folders, including my home folder. Still the
> > same error.
> >
> > Richard: I tried the -Force parameter, and that didn't help either I'm afraid.
> >
> > Thanks for the tips both of you though. Any other ones?
>
> Do set-content or add-content work?
>
> Not really hading towards a fix just yet, but I don't know how long we
> can troubleshoot this particular system. It is not a common problem any
> of us have seen.
>
> Marco
>
My System SpecsSystem Spec
Old 04-16-2008   #10 (permalink)
Marco Shaw [MVP]


 
 

Re: Out-File: Unknown error "-1".

Evjan wrote:
Quote:

> Hello Marco,
>
> Thanks for the tip. I got the same error using set-content and add-content
> on a ordinary .txt-file. I guess I have to continue using cygwin instead
Email me if you want to try to continue to troubleshoot...

My email on this message is valid. Just remove the "_NO_SPAM_" in it.

Marco
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
"Extensible Authentication Protocol" service gives "The system cannot find the file specified" error Vista networking & sharing
Can't delete inbox mail "an unknown error has occurged." Vista mail
change standardprogram to open a file to "unknown" Vista account administration
attempting to copy to the disk itunes (-53) "unknown error" Vista General
"unknown error" - "error desconocido" Vista mail


Vista Forums 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 Ltd

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