A. In PowerShell, you’ll see \\[null\\] used in commands like this:
\\[null\\] \\[System.Reflection.Assembly\\]::LoadWithPartialName("System.Windows.Forms")
This was especially common in PowerShell 1.0. It reflects the fact that there are many ways to do things in PowerShell, and some of those ways have a software developer twist to them, like this one. Basically, this is executing the command:
\\[System.Reflection.Assembly\\]::LoadWithPartialName("System.Windows.Forms")
It then casts the result (which will usually be some kind of success indicator) as a “null” data type. The practical effect of this is to suppress the output. A more command-line oriented version of this technique is to pipe the output to Out-Null:
\\[System.Reflection.Assembly\\]::LoadWithPartialName("System.Windows.Forms") | Out-Null
Both have exactly the same effect.
0 comments
Hide comments