Welcome › Forums › General PowerShell Q&A › Get-Random from a Document, turn it into variable, then delete it, resave
Essentially want to have a document (random.txt) that will have a list of values in it. It will grab the random line, store it in a variable, display it, then remove it (by re-saving the document appears to be the best method I’ve found).
Rinse and repeat.
My method removes everything. I’ve tried permutations of it, and it doesn’t help.
This is expected behavior when you have
Out-file in same pipeline.
You have two options:
Hope that helps.