Out-file problem

Discussion in 'Mixed Languages' started by balubeto, Jun 24, 2012.

  1. balubeto

    balubeto MDL Senior Member

    Dec 22, 2009
    465
    9
    10
    #1 balubeto, Jun 24, 2012
    Last edited by a moderator: Apr 20, 2017
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. SOCRATE_MMXII

    SOCRATE_MMXII MDL Expert

    Jan 25, 2012
    1,034
    315
    60
    #2 SOCRATE_MMXII, Jun 24, 2012
    Last edited by a moderator: Apr 20, 2017
    To export the data to a text file you have to write like this:
    Code:
    C:\Users\PowerShell> Get-Help * | Get-Help -Detailed >> X:\foldername\filename.txt
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...