# Useful for dealing with the SPAM spools on SmarterMail $Source = "\\h2p-mail1\Smartermail\Spool\spam\hold2" $Dest = "\\h2p-mail1\Smartermail\Spool" Get-ChildItem $Source\* -Include "*.eml","*.hdr" | Foreach-Object { Move-Item $Source\$($_.Name) $Dest\$($_.Name -Replace '(\d{1,3}\.){3}(\d{1,3}IP)\.','') }