Scenario: You want to use PowerShell to make a backup of a specific file across many servers and store it locally. We will perform this on a Web.Config file for IIS. The file once copied will be stored as C:SharebkupWebsvr1-wwwroot_web.config.
Script:
#Collect your Servers into a variable $servers = "WebSvr1","WebSvr2","WebSvr3" #Copy the file from the remote server to a local share $Servers | %{ Copy-Item -Path "\$_c$inetpubwwwrootweb.config" -Destination "C:Sharebkup$_-wwwroot_web.config" }