Provide an example of a complex task you automated using PowerShell or Bash to improve system administration efficiency.