I am creating a new com object to open a popup message
$a = new-object -comobject wscript.shell
$b = $a.popup(“WARNING“,0,”Box title”,0 + 0x30)
I noticed that the object remained opened all the time. Should I need to release it? The commands below will do the job?
$null = [System.Runtime.Interopservices.Marshal]::ReleaseComObject($a)
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()