Can't get all excel processes to stop when closing through Powershell
With this code, I am opening excel(with visible = false so the user cannot see it), writing to a workbook, and then either opening excel(making it visible) after the script ends or closing it completely without saving. When I save excel, leave it open, end the script, and then manually close excel later, there are no background processes in the task manager. However, when I close excel with the script, it remains in the task manager. Here is how I start excel: $script:excel = new-object -ComObject excel.application # create excel object $excel.visible = $false # hide excel window $script