8
Does Out-Host also signify Copy-Item has finished (as Out-Null does)?
(programming.dev)
PowerShell (POSH) is a a task automation command-line shell and scripting language created by Microsoft. It became part of the FOSS community in 2016 and is now available across Windows, Linux, and macOS
Thanks for the reply.
I think your first option can give a false positive if the file is started to exist but hasn’t been completely written to. (Except if
Out-Filealready implies that it’s done being written, so the next part isn’t really needed.)The second one is good, but I don’t need console output. Just logging.
I’m looking for confirmation that both
Out-NullandOut-Filehave the same (side) effect of making sure the file is done being copied before continuing to the next line of the script. If so, I’ll stick withOut-FileOh my bad, I misunderstood your question initially. Yes,
Out-Filewill wait for the previous command to finish just likeOut-Null.awesome