I need to read a file on a remote pc which is frequently modified. As it so happens, it appears that my script is sometimes colliding with a write on the file, rendering it inaccessible. I cannot change the way the file is written to so I have to work with what I have.
I ran a test by having a script continuously reading a file with Get-Content and subsequently starting another script which writes to the file at frequent intervals. At times, the write operation was not possible.
Is it possible that I use get-content on a remote pc without locking the file?