locked
Script Comment-Based Help not working RRS feed

  • Question

  • Hi all,

    I'm trying to get In Script comment-Based help to work and I appear to be failing. Here's the comment block and the very beginning of the script.

    <#
    
    .SYNOPSIS
        This Quotas script is used to display/update folder and user quotas on the NAS cluster.
    
    .SYNTAX
        Quotas -Show [-Volume <NAS Volume>] -Folder <foldername> or -User <username>
        Quotas -Set  [-Volume <NAS Volume>] -Folder <foldername> or -User <username> -Quota <new quota value>
    
    .DESCRIPTION
        Simplifying the complex Dell cmdlets for manipulating and displaying the various quota objects for users and folders.
    
    .PARAMETER Show
        Show the current quota, space used, and space remaining.
    
    .PARAMETER Set
        Update/establish the quota for the folder or user object.
        When setting the quota for a folder for the first time, the folder must exist and it must be empty.
    
    .PARAMETER Volume
        Specify the NAS volume on which to operate.
    
    .PARAMETER Folder
        Specify only the leaf folder of the folder path
    
    .PARAMETER User
        This is the sAMAccountName of the Active Directory user.
    
    .PARAMETER Quota
        The new quota to set. Possible input sizes are GB, MB, KB, B with or without a space.
        The full quantifier must be specified.
        EG: (these are all valid input forms)
            123 GB
            63KB
            507 MB
            363MB
            1000 B
    
    #>
    
    
    Param([switch]$Show,
          [switch]$Set,
          [string]$Volume="Tim-Playground",
          [string]$Folder="",
          [string]$User="",
          [string]$Quota=""
    )
    
    $OneK = 1024
    $OneMeg = 1048576
    $OneGig = 1073741824
    
    Function Quantify {
        Param($Value)
    
        if($Value -ge $OneGig) {
            Return ([math]::Round(($Value/$OneGig),2)).ToString() + "GB"
        } elseif($Value -ge $OneMeg) {
            Return ([math]::Round(($Value/$OneMeg),2)).ToString() + "MB"
        } elseif($Value -ge $OneK) {
            Return ([math]::Round(($Value/$OneK),2)).ToString() + "KB"
        } else {
            Return $Value.ToString() + "B"
        }
    }
    
    Then a few more functions then the main script body.

    And here are my results:

    PS C:\NAS> get-help .\quotas.ps1 -Full
    Quotas.ps1 [[-Volume] <string>] [[-Folder] <string>] [[-User] <string>] [[-Quota] <string>] [-Show] [-Set]

    I can't seem to get anything more than this. Any help would be greatly appreciated.


    -- Tim.

    Wednesday, July 6, 2016 3:40 PM

Answers

  • Hi Tim,

    .SYNTAX is not a legal CBH entry, drop it. The Syntax in PowerShell help for advanced functions is autogenerated based upon ParameterSets.

    Cheers,
    Fred

    Note:

    If you want to show usage, use .EXAMPLE
    If you want to comment or add credits, use .NOTES

    Entries under .EXAMPLE (you can add more than one Example entry) are shown when using Get-Help with -Examples, -Detailed or -Full parameters.


    There's no place like 127.0.0.1


    • Edited by FWN Wednesday, July 6, 2016 3:48 PM
    • Proposed as answer by jrv Wednesday, July 6, 2016 4:12 PM
    • Marked as answer by tmunro55 Wednesday, July 6, 2016 5:42 PM
    Wednesday, July 6, 2016 3:46 PM

All replies

  • Hi Tim,

    .SYNTAX is not a legal CBH entry, drop it. The Syntax in PowerShell help for advanced functions is autogenerated based upon ParameterSets.

    Cheers,
    Fred

    Note:

    If you want to show usage, use .EXAMPLE
    If you want to comment or add credits, use .NOTES

    Entries under .EXAMPLE (you can add more than one Example entry) are shown when using Get-Help with -Examples, -Detailed or -Full parameters.


    There's no place like 127.0.0.1


    • Edited by FWN Wednesday, July 6, 2016 3:48 PM
    • Proposed as answer by jrv Wednesday, July 6, 2016 4:12 PM
    • Marked as answer by tmunro55 Wednesday, July 6, 2016 5:42 PM
    Wednesday, July 6, 2016 3:46 PM
  • Perfect, thanks Fred. Love the easy ones.


    -- Tim.

    Wednesday, July 6, 2016 5:42 PM