I have a powershell script that writes to a text file
$text = "Primary" |Out-File \\DS-01A\WINRedundancy\FailoverStatus.txt
and a batch file that reads in the contents of the text file into a variable.
set /p FAILOVR_STS = <FailoverStatus.txt
The problem is that the batch file does not read the text file correctly. It looks like some conversion is happening after being edited by the shell script as evident in the batch output. It reads B instead of Backup
Not sure what is going on. If i create a new text file and edit it, the batch file reads it correctly.
Any suggestions would be appreciated.


$text =portion of your powershell is pointless. You explicitly output to a file, so there is nothing to be captured with the$textvariable.