Add timing output

to screen and email summary so we can see what takes up time.
New parameter StepTiming turns on lots of date-time stamps.
The actual time the backup of each source started is always put in the summary.
Add localSubnetOnly parameter

If localSubnetOnly is set, then the backup is only done if the destination is a local disk, or on a server file share in a locally-connected subnet.
It checks for destinations like:
- UNC path \\server.domain\backupshare
- Drive mapped with "net use Z: \\server.domain\backupshare"
- Drive mapped with "subst Z: \\server.domain\backupshare"
It can detect all of these, extract the "server.domain", lookup the IPv4 address, then compare that IPv4 address to all of the locally-connected subnets (e.g. LAN cable, wireless, 3G dongle, VPN tunnel) and decide if the server is local or not.
Thus we can do laptop backups to a "home office" server only when the laptop is actually in its "home office". When it is at another office across the VPN intranet (or off the intranet completely) the backup task will report that the destination share is not in a local subnet.
Merge pull request #5 from phil-davis/patch-1

Add timing output + Add localSubnetOnly parameter
Igoner adapters with no real IPv4

Some adapters returned by Class Win32_NetworkAdapterConfiguration can have IPv4 address 0.0.0.0 and blank IPSubnet, even though we filtered for ipenabled=true.
This tests for that sort of rubbish and ignores it.
Merge pull request #7 from phil-davis/patch-2

Ignore adapters with no real IPv4
Allow Delorean backup to work with hidden folders

If the input folder for the backup is a hidden folder (like we are hiding D:\Tmail from the user) then the output backup on "X:\Backup\Tmail - datetime" is also a hidden file.
When looking for previous backups in backup destination like X:\Backup, we need to force Get-ChildItem to return all files, and then to see if it is a directory, the attributes just need to contain (-match) "Directory". For a hidden directory, Atrributes returns "Hidden, Directory".
Merge pull request #8 from phil-davis/patch-3

Allow Delorean backup to work with hidden folders
Add emailJobName option

This allows the user to specify a little bit of text that goes in the email subject, along with the hostname and username. This is handy when there are multiple different backups for different purposes on the same host. It makes it easy to distinguish the different backup emails by email subject. e.g.
-emailJobName 'to NAS'
The email subject becomes something like:
Backup of: OFFICE-DC-01 to NAS by: backup.account

Also added output of backupMappedPath to the email body summary. That helps when drive X:\ is actually mapped to some file share \\office-nas.company.com\backup - then the user can see in the email body where the backup destination drive letter was actually mapped to.
Merge pull request #9 from phil-davis/patch-1

Add emailJobName option
Features and fixes for rc8

1) Bug fix - the list of old backups was not explicitly sorted, and it turned out that the newest "previous backup" was being deleted rather than the oldest.
2) When deleting old backups, they did not always get deleted because Remove-Item was respecting read-only files. Could have fixed that by adding the -Force option. But also Remove-Item fails on files with total path names exceeding the "about 260" character limit. So Remove-Item is replaced by running ln -deeppathdelete - that seems to really delete stuff.
3) Enhancement - support the --noads and --noea args that ln supports, so they can be passed through if needed.
4) timetolerance arg is now applied to full copy, as well as Delorian copy.
Do not report when 0 or negative backups to delete

The script was logging silly messages like "Deleting -29 old backup(s)".
Added the test:
if ($backupsToDelete -gt 0)
so all that code is only entered if there is actually something old backup(s) to delete.
The diff looks like rubbish because a whole block of code was indented.
Merge pull request #13 from phil-davis/patch-2

Features and fixes for rc8
Update ntfs-hardlink-backup.ps1

1) Various white space and minor text updates
2) Add localSubnetMask - this allows the user to tell us how wide a range of IP addresses are considered local to the network backup device. Use it if you have a number of subnets at an office that are high-speed and you are happy to backup to file shares across those subnets. It relies on the network design being such that the subnets at an office can be summarised into 1 large subnet/CIRD mask.
3) If a log file is not specified, then generate a date-time-stamp.log file name in the backup destination. If just a folder is specified, then generate a date-time-stamp.log file name in the specified folder. Otherwise do like before, write/append to the specified log file.
4) Handle finding old backups so that it finds even old backup folders that are hidden.
5) Delete old log files also - keeping the same number as backups to keep.
Improve message when destination does not exist
Merge pull request #14 from phil-davis/patch-1

RC9 enhancements and fixes
Add support for reading parameters from INI file

New parameter:
-IniFile filepath
e.g.
ntfs-hardlink-backup.ps1 -IniFile C:\Tools\Backup\Bat\Backup.ini

See example INI file for details of the format.
Add mention of INI file
Create backup-sample.ini

Provides a sample of what an INI can look like, including comments to explain what to put in it and where.
Create backup-sample.bat

An example of the command line to use in a BAT file to invoke powershell, run the ntfs-hardlink-backup.ps1 and use parameters from backup-sample.ini
Create backup-to-nas.bat