output of only part of the script

Welcome Forums General PowerShell Q&A output of only part of the script

This topic contains 3 replies, has 2 voices, and was last updated by

 
Participant
1 year, 7 months ago.

  • Author
    Posts
  • #67468

    Participant
    Points: 1
    Rank: Member

    Hi all

    I have this:

    (dir D:\WS\App1\bin\RL.Cservice.Core.dll).VersionInfo | select @{N='App1';E={$_.FileVersion}}
    (dir D:\WS\App2\bin\RL.Cservice.Core.dll).VersionInfo | select @{N='App2';E={$_.FileVersion}}

    The problem is that when I run it , I get only reply on the fist line
    (
    App1
    ———–
    1.2.34.0
    )

    I need to be able to get answer for each line (there are more than these 2 in total)
    (something like
    App1
    ———–
    1.2.34.0

    App2
    ———–
    1.2.34.0
    )

    so I will be able to export it as report in HTML/txt or different type.

  • #67480

    Participant
    Points: 154
    Helping Hand
    Rank: Participant

    You really should start to learn the basics of Powershell. You could do something like this:

    Get-Item -Path "D:\WS\App*\bin\RL.Cservice.Core.dll" | Select-Object -Property Directory,BaseName,Extension,@{Name='FileVersion';Expression={$_.VersionInfo.FileVersion}}
    • #67504

      Participant
      Points: 1
      Rank: Member

      I know the basics of Powershell and you even didn't answer the question.
      anyway , I already solved this .

    • #67521

      Participant
      Points: 154
      Helping Hand
      Rank: Participant

      I answered your question. Did you try the code I posted?

The topic ‘output of only part of the script’ is closed to new replies.