As promised here is the function to delete mail items in a specific folder function remove-mailitem {
[ CmdletBinding ( SupportsShouldProcess = $true ) ]
param (
[ parameter ( Mandatory = $true ) ]
[string] $mailfolder ,
[datetime] … Read the full text.