So I'm trying to write a quick script to help my son study for his spelling bee. I've got almost everything working, but I'd like to track his results, so I'm trying to write to output to a text file. I only care about the most recent results, so I delete the existing results file when he starts the test.
I'm doing a for each for his spelling list, and at the end of each, I have either:
write-host "Word $counter - You spelled $wordcorrectly!!" | Out-File $outputpath -Append
or
write-host "Word $counter - Sorry. The correct spelling is $word." | Out-File $outputpath -Append
Finally, after it goes through all the list, I have:
write-host "You answered $counter out of $WordCount correctly" | Out-File $outputpath -Append
But when I go to the $outputpath file, it's completely blank... Any guess on what simple mistake I'm making here?