Build: v5.8.213
OS: Windows 7 Professional (64 Bit)
powershell: v5.1
about Enable C# Add-Type type definition loading ,I encountered the following problem (See the following demo)
1.There is no namespace and class name in the [ ] auto-completion list
It will be more convenient to display them in the auto-complete list, both VSC and ISE include this feature
2.There is no New constructor
Static classes(Contains all built-in classes) should have New constructor, both VSC and ISE include this feature
3.No output return value
Values can be output in IDEs such as ISE and VSC
Solving the above problems is very important for using C# classes, I look forward to developers reviewing them, thank you very much
Code: Select all
$cs = @'
namespace Ns1
{
public class Cl1
{
public static void Hi()
{
System.Console.WriteLine("hello!");
}
}
}
'@
Add-Type -TypeDefinition $cs
[Ns1.Cl1]::Hi()