I am using Invoke-SqlCmd and I don’t understand one things : "[int]:: "

What is the mining of the two “:” before declaration of type ? It’s used in the -MaxCharLength

Thank to you,


The :: is part of the calling sequence when you call native .NET classes or get static fields.

In this the .NET class is System.DateTime and the static field is Now.

Shamelessly copy/pasted from here, where there is also more information on how to use it…

You do not declare a variable type with this syntax you access the properties and methods. Try

… the output will be
. And for
it will be

Thank for your reply Olaf and Lars

Last one question about this, why need i to specify Type with [INT] before using this native classes ?


Have a nice day,