Dear,
A real problem can be there with the RedirectOutput operation.
Running same script again and again in a very short time may create a
deadlock situation and return those script in a limbo state. A state
which is mostly controlled at that point by the kernel of windows.
During both RedirectOutput operations you doesn't have collect all
wanted information at that point, which will increase the amount of
time those files are open for the real action.
We extend your code
code:
$sysinfo_file_location = "\\helios\test\testO\SysInfo\$new_date $new_time @WKSTA"
$comp_info_directory_location = "\\helios\test\testO\compinfo"
$comp_info_file_location = "\\helios\test\testO\compinfo\@WKSTA\$new_date $new_time"
with @msecs
code:
$sysinfo_file_location = "\\helios\test\testO\SysInfo\$new_date $new_time @WKSTA.@msecs"
$comp_info_directory_location = "\\helios\test\testO\compinfo"
$comp_info_file_location = "\\helios\test\testO\compinfo\@WKSTA\$new_date $new_time.@msecs"
Also we advice to use Open/WriteLine/Close or WriteProfileString as functions
for writting information to a file.
greetings.