I have written the below to error trap an empty array and it isn't working. Any ideas on the syntax I need?
$inputstring = "MyOtherFile.rdl" "MyFile.rdl"
$cleanstring = $inputstring.replace(""" """,";")
$filearray = $inputstring.split(";")
if (echo @($filearray).length = "0")
{$filearray.length
'No Files Selected'
exit}
else
{$filearray.length}
It is returning 2 for the array length but is still tripping the 1st part of the IF and saying no files selected.
-eq,-ne,-gtand so on.echoin a condition. Otherwise, the equality operator for bash is==.