- AWS Tools for PowerShell 6
- Ramesh Waghmare
- 229字
- 2021-07-15 17:09:14
Comment-based help
Another very important thing in PowerShell that you must know is that you can build the script with in-built help. There are no separate files that you need to maintain for your script. This is an amazing capability. There are two ways that you can write help lines in your PowerShell Script. You can either use a hash (#) in the line to indicate it's a help, or you can make use of the <#..#> block level comment. Let's use the following script to continue the discussion:

I specified a block level comment in <#..#> with some other interesting things. Once the parsing engine sees the block of lines inside <#..#>, it starts ignoring the text and knows that it is help comment. But pay special attention to the lines inside that block, which are started with a dot (.). It has a special meaning in PowerShell. PowerShell starts building your help file once it sees this dot. This is extremely helpful in PowerShell when you build a complex script that can be used by others. There is no need to maintain a separate help file. It is just like the help you seek for any other cmdlet available in PowerShell. You can simply now type the following and see the magic:
PS C:\>Get-Help .\PS_Comment.ps1 -detailed

So, you just built a help file that looks like the cmdlet help.
- Learning NServiceBus(Second Edition)
- Mobile Application Development:JavaScript Frameworks
- Learning Cython Programming
- 自然語言處理實戰(zhàn):預(yù)訓(xùn)練模型應(yīng)用及其產(chǎn)品化
- Learning Apex Programming
- Java異步編程實戰(zhàn)
- MongoDB權(quán)威指南(第3版)
- WordPress 4.0 Site Blueprints(Second Edition)
- 劍指大數(shù)據(jù):企業(yè)級數(shù)據(jù)倉庫項目實戰(zhàn)(在線教育版)
- Access 2010數(shù)據(jù)庫應(yīng)用技術(shù)實驗指導(dǎo)與習(xí)題選解(第2版)
- 智能手機故障檢測與維修從入門到精通
- INSTANT Apache ServiceMix How-to
- Python Digital Forensics Cookbook
- Java 9 with JShell
- 零基礎(chǔ)學(xué)編程系列(全5冊)