I have a script that executes three separate code blocks. The first block performs a query and then creates a text file with the results. The second block performs a second query and then attempts to append it's results to the text file originally created in the first block. The second block ends up failing because a process in the first block still holds the file open. What is proper way to close out this connection before moving onto the next code block? I am using out-file. Thanks for any help that is given.
Tags:
email,
power_shell,
out-file