powershell runspace

I have a visual studio project that executes a powershell script.
Within that script, it launches another script that sets up my environment - one portion of that being to read from a configuration xml file.  
Within that second script, I decode one setting because it has html characters that don't seem to play nice.

So, I have
[string]$myVar = [system.web.httputility]::htmldecode($settings.config.myHTMLstring)

When my vs project launches, it throws an exception as the invoke method stating:
Unable to find type [system.web.httputility]: make sure that the assembly containing this type is loaded.

What can I do to get this working?
LVL 67
sirbountyAsked:
Who is Participating?
 
oBdACommented:
Add this somewhere at the beginning of the script:
Add-Type -AssemblyName System.Web

Open in new window

0
 
sirbountyAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.