I am trying to create a powershell script that will append a character to my variable only if the variable is not null. For instance a user fills out a form, or spreadsheet cell in my case and it has data I want to append a | to that variable so when I call that variable in my script it will display | contents of variable. This is what I have and it does not seem to be working.
if ([string]::IsNullOrEmpty($field6))
{$field6 = $field6}
else
{$field6 = "| $field6" }
}
echo $field6