I have already tried something like:
While (Test-Path -Path $destinationApplicationFolder){
Try{
Remove-Item -Recurse -Force $destinationApplicationFolder -ErrorAction Stop
}catch{
IF((Test-Path -Path $destinationApplicationFolder) -eq $false) {
Write-Warning "File or directory does not exist."
}
Else {
#Get-Process | foreach{$processVar = $_;$_.Modules | foreach{if($_.FileName -eq "$destinationApplicationFolder\CC.Core.POCO.dll"){$processVar.Name + " PID:" + $processVar.id}}}
#Stop-Process $processVar -Force
Get-Process | ?{$destinationApplicationFolder.path -and (test-path (split-path $destinationApplicationFolder.path -leaf ))} | Stop-Process -whatif
}
}
}
Is it possible to do this without installing other software?