Page 1 of 1

Unable to exclude files with command line

Posted: Sat Jan 09, 2016 6:05 am
by caustrom
I'm trying to automate a deployment process by incorporating the copy of all "new" & "modified" files to a staging server ... I want to be able to exclude all files with the following extensions: xml, pdb & bak ... I'm executing the following statements within a powershell script:

Code: Select all

$Product = "XXXX"
$DeploymentDate = "YYYY-MM-DD"
$ExamDiffProgram = "C:\Program Files\ExamDiff Pro\ExamDiff.exe"
$ExamDiffFileExclusion = "*.xml,*.pdb,*.bak"
$ExamDiffFileInclusion = "*.xml,*.pdb,*.bak"
$ExamDiffLog = "C:\Temp\ExamDiff_$($Product)_$($DeploymentDate).log"

$SourceDirectory = '\\<DROP SERVER>\Builds\<BUILD DEFINITION>\<BUILD NUMBER>\_PublishedWebSites\<WEB APPLICATION>'
$TargetDirectory = '\\<DEPLOY SERVER>\Inetpub\<WEB SITE>\<WEB APPLICATION>'

$ExamDiffArguements = "$SourceDirectory $TargetDirectory /fi:$ExamDiffFileInclusion /fx:$ExamDiffFileExclusion /r2 /i /w /k /dv /o:$ExamDiffLog"

$Process = ( Start-Process -FilePath "$ExamDiffProgram" -ArgumentList $ExamDiffArguements -Wait -PassThru )
ExamDiff is able to compare $SourceDirectory to $TargetDirectory; however it does not exclude files: $ExamDiffFileExclusion

What am I missing?
Carl.

Re: Unable to exclude files with command line

Posted: Sat Jan 09, 2016 11:20 am
by psguru
Without digging too deep, your include and exclude filters are identical: "*.xml,*.pdb,*.bak".

Re: Unable to exclude files with command line

Posted: Mon Jan 11, 2016 9:42 am
by caustrom
Sorry, that was a copy / paste issue ... actual values are:

Code: Select all

$ExamDiffFileExclusion = "*.xml,*.pdb,*.bak"
$ExamDiffFileInclusion = "**.*"

Re: Unable to exclude files with command line

Posted: Mon Jan 11, 2016 11:45 am
by psguru
Try simplifying your test case, maybe just running with hardcoded values (not scripted ones). I just ran with a simple test with

Code: Select all

 /fx:*.txt /fi:*.*
and everything worked as expected.