Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


external assemblies

 
Logged in as: Guest
arrSession:exec spGetSession 2,5,31521
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows PowerShell >> external assemblies
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 external assemblies - 2/24/2006 9:28:56 AM   
  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
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows PowerShell >> external assemblies Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts