In C# I can use the method Console.Error.WriteLine. This doesn’t work in Powershell, instead I must write
[Console]::Error.WriteLine
Why square brackets, why the double colons?
ps. To be clear, I’m not interested in logging, I want to understand the syntax about types and objects and methods
Brackets = access to a type
double colons = access to a static member of a type : [MyType] return a Type instance
ex:
using the dot notation would only give you access to instance members of the Type instance (reflection related methods for most)…
so :: is the way to access static members of a Class