| |
bengladwell
Posts: 1
Score: 0
Joined: 2/24/2006
Status: offline
|
I recently figured out how to send a SMTP message in MSH by importing an external .NET assembly (I figured this out by reading this article: http://arstechnica.com/guides/other/msh.ars/6, which I highly recommend). So, my script looks like this: [Reflection.Assembly]::LoadWithPartialName("System.Web") $objMail = new-object Web.Mail.MailMessage $objMail.to = "gladwellb" $objMail.from = "gladwellb" $objMail.subject = "Test Subject" $objMail.body = "Test Body" [System.Web.Mail.SmtpMail]::smtpserver = "<ip of our mail server>" [System.Web.Mail.SmtpMail]::send($objMail) This works fine. When LoadWithPartialName("Sytem.Web") executes, the shell outputs: GAC Version Location --- ------- -------- True v2.0.50727 C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll which is telling me that the assembly dll was loaded into memory. My Question: When, if ever, is this assembly released from memory? Thanks - Ben
|
|