Share via


PowerShell Tip: How to add help URI for functions?

Question

Does PowerShell allows us to add our blog URL for help? We tried using helpuri but failed.

Answer

It's possible by adding helpuri in cmdletbinding

help

help about_Functions_CmdletBindingAttribute

Demo

<#
 .SYNOPSIS
  PowerShell Demo to add help uri.
 
 .DESCRIPTION
  This PowerShell function add two values.
 
 .PARAMETER Value1
  Enter number
 
 .PARAMETER Value2
  Enter Number
 
 .NOTES
  Additional information about the function.
    
    .LINK
        http://www.bing.com
#>
function Add-Values
{
[CmdletBinding(ConfirmImpact = 'Low',
   HelpUri = 'http://www.bing.com')]
param
(
[Parameter(Mandatory = $true,
   HelpMessage = 'Enter number')]
[int]
$Value1,
[Parameter(Mandatory = $true,
   HelpMessage = 'Enter Number')]
[int]
$Value2
)


}

help Add-Values -Online