Below enters 2 different lines into my Log:
"2019-06-25 16:08:23" "ERROR: " "Copy from C:\Users\Simon.Evans\Documents\Source Data\LNAT\Code_Maping.txt to I:\Dev\BI\Projects\Powershell\Test Area\Source Data\LNAT\Code_Mapping.txt Failed"
"2019-06-25 16:08:23" "ERROR: " "Cannot find path 'C:\Users\Simon.Evans\Documents\Source Data\LNAT\Code_Maping.txt' because it does not exist."
Is it possible to combine the 2 or use both in just one line/entry?
catch{
$Error[0] | Write-Log -path $varfullpath
Write-log -Message "Copy from $sourceDirectory to $destinationDirectory Failed" -Level Error -path $varfullpath
}