Here is the code I am trying:
...
foreach($RowDelete in $resultsDatatable)
{
echo "Inside For Loop"
echo $RowDelete
write-host “Deleting Duplicate PDF File/ Letterâ€;
# $RowDelete | foreach { $_.Delete()}
# $RowDelete | Remove-Item -Recurse -WhatIf -ErrorAction SilentlyContinue
Remove-Item -recurse -force $RowDelete -erroraction silentlycontinue -Whatif
}
...
And what I am trying to achieve is deleting the above file using Remove-Item in PowerShell script.
Hope this information helps.
I realize this was posted a while back, but the -Whatif switch tells Powershell to just test and not actually make any permanent changes.