I have list of files, I am trying to copy to another location.
$files = @("abc.ps1", "def.ps1")
$scriptFiles | Copy-Item -Destination "destinationlocation" -Force
So I get an error when file abc.ps1 is not availalbe, Is there a way to Test-Path
by avoiding to write a loop and write in single line?