Here are the steps required to do an automated vanilla install of the latest DirSync tool:
Download the DirSync bits using BITS (the URL always points to the latest version):
Start-BitsTransfer -Source http://go.microsoft.com/fwlink/?LinkID=278924 -Destination c:Tempdirsync.exe
Install the required .NET 3.5 bits:
Add-WindowsFeature -Name NET-Framework-Core
Install DirSync unattended:
.DirSync.exe /quiet
UPDATE: Regarding AADSync
Unfortunately this does not seem to work with the AADSync download.
For AAD Connect this 1-liner works for me to download the tool. I assume it will also point at the latest version at all times.
Start-BitsTransfer -Source https://download.microsoft.com/download/B/0/0/B00291D0-5A83-4DE7-86F5-980BC00DE05A/AzureADConnect.msi -Destination c:\Temp\AzureADConnect.msi