Hi,
The ZapiRetryCount parameter does not apply to all CmdLets (EG Connect-NcController or Connect-NaController) so unfortunately you can't set a default ZAPI retry for the cluster connection, however what you can do is create custom commands that define the ZapiRetryCount as an input parameter then set a constant in your workflow and apply the constant to the command variable values. For example:



Here is the source code for the command as an example:
Param(
[Parameter(Mandatory = $True, HelpMessage = "The name or IP Address of the cluster")]
[String]$ClusterName,
[Parameter(Mandatory = $True, HelpMessage = "The name of the vserver")]
[String]$VserverName,
[Parameter(Mandatory = $True, HelpMessage = "The path of the directory to read")]
[String]$Path,
[Parameter(Mandatory = $False, HelpMessage = "The maximum number of ZAPI retry attempts")]
[Int]$ZapiRetryCount
)
#'------------------------------------------------------------------------------
#'Connect to the cluster
#'------------------------------------------------------------------------------
Connect-WFACluster $ClusterName
#'------------------------------------------------------------------------------
#'Create the command to read the directory.
#'------------------------------------------------------------------------------
If(-Not($Path.Contains("/vol/"))){
[String]$Path += "/vol/$Path"
}
[String]$command = "Read-NcDirectory -Path ""$Path"" "
If($ZapiRetryCount){
[String]$command += "-ZapiRetryCount $ZapiRetryCount "
}
[String]$command += "-VserverContext $VserverName -ErrorAction Stop"
#'------------------------------------------------------------------------------
#'Read the directory to ensure it exists.
#'------------------------------------------------------------------------------
Try{
Invoke-Expression -Command $command -ErrorAction Stop
Get-WFALogger -Info -Message "Executed Command`: $command"
Get-WFALogger -Info -Message "The directory ""$Path"" exists on vserver ""$VserverName"""
}Catch{
Get-WFALogger -Info -Message $("Failed Executing Command`: $command. Error " + $_.Exception.Message)
Throw "The Directory ""$Path"" does not exist on vserver ""$VserverName"""
}
#'------------------------------------------------------------------------------
Note: I'd recommend setting the ZapiRetryCount as a non-mandatory parameter within your commands.
/Matt
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.