The issue with a .txt file could be a blank line in there or the encoding of the file.
Personally I would keep the Connect-VIServer outside the function.
Doing it inside the function might cause side effects.
The issue with a .txt file could be a blank line in there or the encoding of the file.
Personally I would keep the Connect-VIServer outside the function.
Doing it inside the function might cause side effects.