If I want to create a .NET object in the powershell I write something like the following:
[System.Reflection.Assembly]::LoadWithPartialName("System.Xml") | out-null"
$doc = new-object -typename System.Xml.XmlDocument"
If I want to call a static .Net method I use a command similar to the following line:
$path = [System.String]::Format("{0} {1}", "Hello", "World")
I don't see the rule behind that. If it works in the first example, why can't I use System.String.Format
in the second one?