This article introduces a very special variable in PowerShell, that is $null. The special thing about $null is that it never stores content.
While looking through a book of PowerShell, I found a description of the $null variable, which was very interesting and a close-up to share with you.
Take a look at this example:
Copy Code code as follows:
PS c:\users\zhanghong> $null =1122
PS c:\users\zhanghong> $null
PS c:\users\zhanghong>
Do you understand? The small series assigns a value of "1122" to the $null variable, but when I output it immediately, I find that it has no content.
If we use $null with here string (just @), we can get multiple lines of comment. and see the effect:
Copy Code code as follows:
#正常注释
$null =@ "
Comment Content Line 1
Comment Content Line 2
Comment Content Line 3
@"
#正常注释
We can realize the magical $null variable.
OK, about PowerShell special variable $null, Hongo introduced so, hope to help everyone.