I try to make this script working
Function test_var
{$return = 0
foreach ($arg in $args)
{
if (!$arg) {(Write-Host "ERROR : $arg.Name Missing variable" -ForegroundColor Red -BackgroundColor Black)
$return = 1}
}
return $return
}
When I call the function with arguments
test_var "c" "$b" "$a"
The function work correctly but I can't display the name of the actual $arg
because the value was empty .