Microsoft Virtualization Discussions

Re: Configuration info for a controller

I see... My challenge becomes grabbing the file with the correct date and time... I could strip the time out of the file since I plan to run this only once a day. That would solve my filename problem. Thanks again!

Re: Configuration info for a controller

If you just want to compare to the latest file, that is easy:

$file = get-childitem -path C:\temp | ? { $_.Name -imatch "\.xml" } | Sort-Object LastWriteTime -Descending | select-object -first 1

if ( $file )

{

#  Compare...

  $optionsOld = Import-CliXml -Path $file.FullName

}

else

{

   throw ("No files found to compare!")

}

Re: Configuration info for a controller

Thank you for the quick response! I've learned quite a bit since posting here! You guys are a great resource and I really appreciate the help.

Forums