New-CommanderCustomProtocol
SYNOPSIS
Creates a custom protocol handler.
SYNTAX
New-CommanderCustomProtocol [-Protocol] <String> [-Action] <ScriptBlock> [<CommonParameters>]
DESCRIPTION
Creates a custom protocol handler.
EXAMPLES
EXAMPLE 1
New-CommanderCustomProtocol -Protocol "Commander" -Action {
Start-Process code -ArgumentList $Args[0]
}
Starts code when the Commander protocol is used. Commander://test.txt
PARAMETERS
-Protocol
The protcol scheme to use.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Action
The action to execute when the file type is opened. $Args[0] will be the full file name of the file opened.
Type: System.Management.Automation.ScriptBlock
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.