if statement - Adding string to variable powershell -


i trying create powershell script append character variable if variable not null. instance user fills out form, or spreadsheet cell in case , has data want append | variable when call variable in script display | contents of variable. have , not seem working.

 if ([string]::isnullorempty($field6))   {$field6 = $field6}  else    {$field6 = "| $field6" }    } echo $field6 

this should suffice:

if ($field6 -ne $null) { $field6 = "| $field6" } 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -