Powershell : Avoid exe running in another window

Welcome Forums General PowerShell Q&A Powershell : Avoid exe running in another window

This topic contains 1 reply, has 2 voices, and was last updated by

 
Moderator
2 years, 3 months ago.

  • Author
    Posts
  • #52013

    Participant
    Points: 0
    Rank: Member

    I have a script which will call tsm.exe and perform backup of the Directory for that Period .
    I am using Invoke-command or Start-process it executes quite ok but tsm.exe is open in a new window , I don't want it to run in another window , I need to capture the output and want to redirect it in log

    Period=ARC_1YR
    Directory=\\servername\n$\backup
    Invoke-Command -Filepath d:\Backup\tsm.exe -ArgumentList $Period, $Directory

  • #52019

    Moderator
    Points: 24
    Team Member
    Rank: Member

    Hi Sachin,

    Please check out below article and see if that works for you.

    http://blog.coretech.dk/rja/capture-output-from-command-line-tools-with-powershell/

    Best,
    Daniel

The topic ‘Powershell : Avoid exe running in another window’ is closed to new replies.