Quantcast
Results 1 to 3 of 3

Out-file problem

  1. #1
    balubeto is offline Junior Member
    Enjoys Windows 7 Forums
     
    Join Date
    Apr 2012
    Posts
    20
    Windows 7/Server 2008 R2 MS Internet Explorer 9.0

    Out-file problem

    Hi

    In the PowerShell 2.0 console in Windows 7 SP1, I wrote:

    Code:
    PS C:\Users\test\Documents\PowerShell> Get-Help * | Get-Help -Detailed | Out-File C:\Users\test\Documents\PowerShell\PowerShell_2,0_Guide.txt
    Out-File: Can not convert 'System.Object[]' to 'System.String' type required from 'FilePath' parameter. Specified method is not supported.
    In line:1 car:43
    + Get-Help * | Get-Help -Detailed | Out-File <<<<  C:\Users\test\Documents\PowerShell\PowerShell_2,0_Guide.txt
        + CategoryInfo          : InvalidArgument: (:) [Out-File], ParameterBindingException
        + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.OutFileCommand
    PS C:\Users\test\Documents\PowerShell> Get-Help * | Get-Help -Detailed > C:\Users\test\Documents\PowerShell\PowerShell_2,0_Guide.txt
    Get-Help : Can not convert 'System.Object[]' to 'System.String' type required from 'Name' parameter. Specified method is not supported.
    In line:1 car:22
    + Get-Help * | Get-Help <<<<  -Detailed > C:\Users\test\Documents\PowerShell\PowerShell_2,0_Guide.txt
        + CategoryInfo          : InvalidArgument: (:) [Get-Help], ParameterBindingException
        + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.GetHelpCommand
    PS C:\Users\test\Documents\PowerShell>
    Where I'm wrong?

    Thanks

    Bye
    balubeto

    Reply With Quote Reply With Quote

  2. #2
    debugthis is offline Junior Member
    Enjoys Windows 7 Forums
     
    Join Date
    Jun 2012
    Posts
    2
    Windows 98 MS Internet Explorer 6.0

    Re: Out-file problem

    Well, it's been 3 weeks, so this doesn't matter anyway. I'm CLUELESS of powershell, I don't use "seven" hardly at all, I'm Xp-based. Two things i'd try: put quotes around the outfile argument, and/or replace pipe with redir:
    C:\Users\test\Documents\PowerShell> Get-Help * | Get-Help -Detailed >"C:\Users\test\Documents\PowerShell\PowerShell_2,0_Guide.txt"
    or:
    C:\Users\test\Documents\PowerShell> Get-Help * | Get-Help -Detailed | Out-File "C:\Users\test\Documents\PowerShell\PowerShell_2,0_Guide.txt"

    Not knowing jiz about ps, this is all I can suggest. I have seven, but haven't used it.

    Reply With Quote Reply With Quote

  3. #3
    AceInfinity's Avatar
    AceInfinity is offline Member
    Computer Mainstream Pro
     
    Join Date
    Aug 2011
    Posts
    46
    Windows 8 Firefox 17.0

    Re: Out-file problem

    I'm a PowerShell guy

    First question, why are you piping the output of one help command to another?
    Code:
    Get-Help * | Get-Help -Detailed
    Another thing, don't use hardcoded paths, use environment locations:
    Code:
    "$env:UserProfile\Documents\PowerShell\PowerShell_2,0_Guide.txt"
    Here's what you want:
    Code:
    Get-Help * | Format-Table Name, Category, Synopsis | Out-File "$env:UserProfile\Documents\PowerShell\PowerShell_2,0_Guide.txt"

    VB/C# Programming - (2012 - Present)
    ®Crestron - DMC-T Certified Programmer


    ~ "The universe is an intelligence test." - Timothy Leary ~

    Reply With Quote Reply With Quote

Similar Threads

  1. Replies: 0
    Last Post: 03-26-2012, 07:18 AM
  2. file problem
    By dsaul in forum Windows 7 Software
    Replies: 2
    Last Post: 01-15-2012, 01:55 PM
  3. Problem with .exe file association
    By melbatniji in forum Windows 7 Support
    Replies: 2
    Last Post: 01-11-2012, 01:53 AM
  4. Hidden file problem
    By onetrack in forum Windows 7 Support
    Replies: 10
    Last Post: 05-29-2010, 07:45 AM
  5. Zip File Icon Problem...
    By Mystery in forum Windows 7 Support
    Replies: 4
    Last Post: 02-07-2010, 05:19 PM

Visitors found this page by searching for:

Search engine data is still being processed!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •