Can we add a -Backup flag (or maybe it takes a path)? e.g. hosts.bak is created before write operations? This would act as a nice failsafe when anything goes wrong.
As an alternative, what if write fails were caught and the contents were instead saved to a temp file (the location of which was included in the error message)?
Can we add a
-Backup
flag (or maybe it takes a path)? e.g.hosts.bak
is created before write operations? This would act as a nice failsafe when anything goes wrong.