The PowerShell annotation character is divided into row and block annotation characters. A line annotation uses the pound sign (#) to cause a row, and a block annotation uses "<#" and "#>" to cause a comment.
Line annotation Character
Examples are as follows:
Copy Code code as follows:
# define a Count variable
$i = 0
Block annotation, multiline comment
Examples are as follows:
Copy Code code as follows:
<#
File: Xxx.ps1
Use: the XXX feature script for testing
Create: 2013-03-27,jb51.net
Modification: 2013-09-04,jb51.net
#>
This is a piece of content that will be defined for scripting purposes and instructions before each write script. It is in the form of annotations, recommended that everyone do so, to facilitate later know the function of the script, source, version, and so on.
About C # 's annotation characters
Although PowerShell scripts are heavily compliant with C # syntax rules, C # Annotation characters cannot be used in PowerShell.
Examples are as follows:
Copy Code code as follows:
PS c:\users\zhanghong>//111
The '//' item cannot be recognized as a cmdlet, function, script file, or the name of a running program. Check the spelling of the name, if the path is included, make sure the path is correct, and then try again.
About the use of PowerShell annotation, small series on the introduction so much, I hope to help you, thank you!