Hello all,
I am starting to experiment with using .NET classes with Powershell but I lack understanding as to why this doesn't work:
Add-Type -AssemblyName System
$obj = New-Object System.Diagnostics.Process
$obj.Start('Notepad')
Cannot find an overload for "Start" and the argument count: "1".
At line:4 char:1
+ [void]$obj.Start('Notepad')
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
However this does work:
Add-Type -AssemblyName System
[System.Diagnostics.Process]::Start('Notepad')
Thanks for any help or insight you can provide.