![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | Newbie : powershell file creation ... hi, I just installed powershell on my pc (which has the required configuration) but i can not even make simple task like file creation such as : PS W:\> "hello !" | Out-File c:\test.txt It returns this error below : Out-File : Unknown error "-1". At line:1 char:21 + "hello !" | Out-File <<<< c:\test.txt I have searched for such topic on the web but nothing... Someone can help please ? Thanks. |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Newbie : powershell file creation ... sko002 wrote:
WPS> "Hello" > c:\test.txt Simple, no? =) Also: WPS> get-help set-content -- Klaus H. Probst http://www.simulplex.net/ | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Newbie : powershell file creation ... On Oct 10, 1:07 pm, sko002 <sko...@xxxxxx> wrote:
possible you don't have the proper permissions to write to C:\? Try creating the file with redirection, and see if you get the same result: "hello !" > c:\test.txt Jeff | ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Newbie : powershell file creation ... Hi Klaus, Sorry I may be unclear in my problem description. I wanted to use powershell for some tasks that cmd.exe can not do or do it easier at least ! My problem is that powershell returns an error when I execute simple command like : "hello !" | Out-File c:\test.txt ... do you see what i mean ?! "Klaus H. Probst" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #5 (permalink) |
| Guest | Re: Newbie : powershell file creation ... Could you check the version installed, both outputs should be 1.0.0.0: (Get-Command Out-File).dll -replace '^.+((\d+\.){3}\d+).+$', '$1' "$((Get-Host).version)" -- Kiron |
My System Specs![]() |
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Newbie : powershell file creation ... Hi Jeff, I have admin permissions on my PC ... Same error with redirection : PS C:\> "hello !" > c:\test.txt Unknown error "-1". At line:1 char:12 + "hello !" > <<<< c:\test.txt "Jeff" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) | ||||||||||||
| Guest | Re: Newbie : powershell file creation ... Hi Kiron, Yes same version ! ![]() PS W:\> (Get-Command Out-File).dll -replace '^.+((\d+\.){3}\d+).+$', '$1' 1.0.0.0 PS W:\> "$((Get-Host).version)" 1.0.0.0 "Kiron" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #8 (permalink) |
| Guest | Re: Newbie : powershell file creation ... Try this: powershell -noProfile {"hello !" | Out-File c:\test.txt} -- Kiron |
My System Specs![]() |
| | #9 (permalink) | ||||||||||||
| Guest | Re: Newbie : powershell file creation ... damn ! Still the same !!! : ( PS W:\> powershell -noProfile {"hello !" | Out-File c:\test.txt} Out-File : Unknown error "-1". At line:1 char:21 + "hello !" | Out-File <<<< c:\test.txt "Kiron" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #10 (permalink) |
| Guest | Re: Newbie : powershell file creation ... It is very odd sko002. I've never heard of 'unknown error "-1"'. You have the right version and you tried executing from a PowerShell session without user Profile... but the error persists. I can't think of any other suggestion than to either wait, there are very knowledgeable members on this group that can help; or unisntall PowerShell, download the version for your platform again and reinstall it. Sorry I couldn't help more. -- Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Newbie: WMI and Powershell | Jeff | PowerShell | 5 | 10-11-2007 11:24 AM |
| Newbie to Powershell | Angelo | PowerShell | 1 | 07-04-2007 04:28 PM |
| Newbie Question - Uses for PowerShell | Kim Finleyson | PowerShell | 11 | 06-28-2007 07:20 PM |
| Newbie to PowerShell | Nik | PowerShell | 3 | 04-06-2007 05:21 PM |
| newbie - How to use FTP in powershell | Andy.I | PowerShell | 2 | 02-12-2007 05:23 AM |