Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Release a COM Object in PowerShell

$
0
0

Summary: Learn how to release a COM object in Windows PowerShell. 

 My Windows PowerShell automation script uses a COM object. How can I make sure that it releases?

  Use the ReleaseCOMObject static method from the Marshal class. Pass it the variable that holds the COM object. Here is an example:

[System.Runtime.Interopservices.Marshal]::ReleaseComObject($doc) | Out-Null


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>