ISPStsadmCommand.GetHelpMessage Method
Gets a remark about the syntax of the specified custom operation. This method is deprecated and may not be supported in future releases of . For custom command line operations, see the Microsoft.SharePoint.PowerShell namespace.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Parameters
- command
- Type: System.String
The operation about which help is sought.
Return Value
Type: System.StringA String that represents a description of the syntax of the operation command.
Caution
|
|---|
|
This method is documented only to provide assistance in troubleshooting existing extensions of STSADM.EXE. Do not create new extensions. Instead, extend PowerShell. See the Microsoft.SharePoint.PowerShell namespace. |
GetHelpMessage is called when the user enters the following at the system prompt, where myOperation is the name of your custom operation.
stsadm -help myOperation
The help message is streamed to the console.
GetHelpMessage is also called when Run returns SyntaxError().
The String that is returned is usually the only syntax help available to users of the command operation. So include everything that they needs to know, including the possible parameters, if any, that can be used with the operation.
Use standard syntax guidance style.
Use "[" and "]" to indicate material that is optional.
Use "{" and "}" to indicate material that is required.
When more than one parameter can be used, use "|" to separate the alternatives.
Variables should be enclosed in "<" and ">".
The following string is automatically prepended to the return value; do not set it explicitly.
"stsadm -o command \n"
The command is the name of your custom operation.
The following, for example, is the message returned by stsadm -help activatefeature. Note the use of indentation to improve readability.
stsadm -o activatefeature
{-filename <relative path to Feature.xml> |
-name <feature folder> |
-id <feature Id>}
[-url <url>]
[-force]
The following example shows an implementation of GetHelpMessage for a simple operation that takes a parameter named "url". Note that because the custom class in this example creates only one new operation, the method does not need to read the command parameter. If more than one new operation were being defined, the method would need a structure that branched according to the value of command.
using System; using System.Collections.Specialized; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.StsAdmin; namespace MS.Samples.SharePoint { public class SimpleCommandHandler : ISPStsadmCommand { public string GetHelpMessage(string command) { // "stsadm -o command \n" is prepended here. return "-url <full url to a site in SharePoint>"; } // Run() implementation not shown. } }
Caution