Hey all,
I'm working on a workflow that deletes a qtree if it has no exports, and then deleting the volume if there are no other qtrees in it.
I created a command to view the number of qtrees which works when I test it. I added a Return Parameter to the code for the command that shows the number of qtrees (although it also includes the root volume). When I try to use that Return Parameter in the Delete Volume command, I get an error that it's an invalid expression. It doesn't look like the numQtree parameter is being passed back to the workflow.
This is WFA 2.2 and I'm creating this for 7-Mode.
I can't figure out how to attach the exported workflow. It gives me an error that the contents of the attachment doesn't match its file type.
Thanks for any help. I can direct mail to anyone who can look.
This is the command that is set to have a Return Parameter.
param (
[parameter(Mandatory=$true, HelpMessage="Volume name")]
[string]$VolumeName,
[parameter(Mandatory=$true, HelpMessage="Array IP or name")]
[string]$Array,
[parameter(Mandatory=$true, HelpMessage="vFiler name")]
[string]$VFilerName,
[parameter(Mandatory=$false, HelpMessage="Qtree name")]
[string]$QtreeName
# [parameter(Mandatory=$false, HelpMessage="Qouta Size")]
# [Long]$QuotaSize
)
# connect to controller
Connect-WfaController -Array $Array -VFiler $VFilerName
#$policy = Get-NcExportPolicy -VserverContext $VserverName -Name $PolicyName
$qtreeQuery = Get-NaQtree -VolumeName $volumeName -QtreeName *
#$qtreeQuery.vfiler = $VFilerName
#$qtreeQuery.Volume = $volumeName
if($qtreeQuery)
{
Get-WFALogger -Info -message $("Check existing qtrees for: " + $volumeName)
$qtreeStatus = Get-NaQtree -VolumeName $volumeName -QtreeName *
}
Get-WFALogger -Info -message $("qtrees exist for volume... : " + $volumeName)
Get-WFALogger -Info -message $("qtreeStatus shows..." + $qtreeStatus)
Get-WFALogger -Info -message $("qtreeStatus shows there are qtrees..." + $qtreeStatus.Count)
Add-WfaWorkflowParameter -Name numQtree -Value $qtreeStatus.Count -AddAsReturnParameter $true
Roger