I've looked at the help on remove-item but did not see what I needed. I need to delete all files that begin with AT and have a .job extension. at*.job I have this script but it does not delete the files. what is the syntax to do this?
$Path="c:\windows\tasks\at*.job"
$Log="\\Server\d$\tools\logging"
$name= (Get-WmiObject-class win32_ComputerSystem -Property*).name
If (Test-Path$Path) {
Remove-Item"$path\at*.job"-Force-Recurse;
$name | Out-File"$log\$name"
}