If i use WFAlogger workflow completing successfully even wrong input.below script is working fine now.
02:12:24.794 INFO [Aggregate Expansion] ### Command 'Aggregate Expansion' in 'POWER_SHELL' ###
02:12:26.747 INFO [Aggregate Expansion] Successfully decrypted the input password
02:12:47.536 ERROR [Aggregate Expansion] wfatest not expanded.
02:12:47.661 INFO [Aggregate Expansion] Command completed, took 22867 milliseconds
$a = $null
$aggradd = Invoke-nassh -Command " aggr add $AggregateName -g $RaidGroupName -T $DiskType $NumberOfDiskToAdd@$DiskSize " -ErrorAction Stop
if($aggradd -eq $a)
{
#Get-WFALogger -Error -message $($aggradd)
throw "Aggregate $AggregateName not expanded, Please check the input parameters and disk availability."
}
else
{
Get-WFALogger -Info -message $aggradd
$aggrstatus = Invoke-nassh -Command " aggr status -r $AggregateName "
Get-WFALogger -Info -message $aggrstatus
#throw "$AggregateName expanded."
}