Powershell

Table of Contents

Assembly and Namespace

Before being able to use namespace class first the assembly needs to be loaded
e.g.
To use the [system.web.httputility] classes methods within the system.web Namespace (assembly).
First the assembly will have to be loaded by looking at the module property (as below screenshot) assembly property.
Then load the assembly
Add-Type -AssemblyName system.web

Or by calling the assembly namespace load method against the assembly
[System.Reflection.Assembly]::LoadWithPartialName('system.web')

Then you can call the class.
E.g.
[system.web.httputility]::HtmlEncode()




# Examples Usage
using namespace system.speech
$obj = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$obj.Speak("test")

To check loaded assemblies
[appdomain]::CurrentDomain.GetAssemblies()

Visit next page to learn about - Scope