Powershell mail all files from directory and move them

Get-ChildItem “C:\FilePorts\ValidationPDFs\*” -include *.pdf | foreach { Send-MailMessage -from “from@mail.com” -to “to@mail.com” -subject $_.name -attachments $_.fullname -smtpServer mail.server }
Get-ChildItem “C:\FilePorts\ValidationPDFs\*” -include *.pdf | move-item -destination “C:\FilePorts\ValidationPDFs\printet”

Powershell delete Paused – Spooling print jobs

Deletes Paused – Spooling print jobs that are older than 12 hours

$PrintJobs = get-wmiobject -class “Win32_PrintJob” -namespace “root\CIMV2” -computername . | Where-Object { $_.JobStatus -eq “Paused | Spooling” -and [System.Management.ManagementDateTimeConverter]::ToDateTime($_.TimeSubmitted) -lt $($(Get-Date).addHours(-12))}

foreach ($job in $PrintJobs)
{
Write-Host “Canceling job $($job.JobId)”
Write-Host “Document: $($job.Document)”
Write-Host “Owner: $($job.Owner)”
$job.Delete()

}