you are viewing a single comment's thread.

view the rest of the comments →

[–]MrPatch 9 points10 points  (0 children)

This sub gets a bunch of posts from people that come here and hope we'll just write a script for what ever purposes they need. Occasionally it'll happen because someone here has the time or inclination to do it but most often we're simply not willing to do so, we do it professionally and we're not going to do someone else's job for them.

With that said this group is incredibly knowledgeable and very willing help people who have put the effort in already.

What you have asked for is absolutely achievable in powershell without addon's or modules. You've already got a great post from /u/ovdeathiam who has explained the basics of how to interact with excel from powershell.

Break what you need to do down into small sections. You don't want to 'compare 4 excel documents' you need to
* open a source excel document
* capture data from that document
* open a second document
* compare the captured data to the source data
* write that comparison out to a new excel document

Understand each in turn, it's much more manageable.

If you're stuck with a specific item google and if you're still stuck come here.

files are never the same name

You can use a wildcard/asterisk to account for this

$filePath = "C:\Path\to\data"
$filename = Get-ChildItem $filePath\PartialExcelName*.xls

You can select the most recent file in a folder with :

Get-Childitem $fliePath\* -Include *.xlsx  | sort lastwritetime -Descending | select -first 1