Start another Program with Parameters

rated by 0 users
This post has 2 Replies | 0 Followers

Not Ranked
Posts 2
ceem Posted: 04-25-2012 11:23 AM

Hey guys

I'm startin to learn Powershell and have troubles starting another Program with Powershell.

When I start the following command everything works well:

LogParser -i:csv -nSkipLines:4 "SELECT Sender-Address, Recipient-Address, Message-Subject, [#Fields: date-time] as date-time FROM 'E:\Exchange Message Tracking Logs\*20120410*' WHERE sender-address LIKE '%net%'" -o:DATAGRID

Ok here comes my script:

    Param
    (
      [parameter(Mandatory=$true)]
      [String]
      $idate
    )

&'C:\Program Files (x86)\Log Parser 2.2\logparser.exe' "SELECT Sender-Address, Recipient-Address, Message-Subject, [#Fields:date-time] as date-time FROM 'E:\Exchange Message Tracking Logs\*$idate*' WHERE sender-address LIKE '%net%'" '-o:DATAGRID'

Obvioulsy it throws an error, but can someone explain to me how I have to set those special characters?

 

 

 

 

Top 200 Contributor
Posts 9

bump.  Please help

Top 75 Contributor
Posts 26

and the error is?

Page 1 of 1 (3 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.