out-file redirects the objects of a pipeline into a file.
Since PowerShell 5.1, the redirection operators are basically aliases for out-file. However, with the parameters that out-file provides, it is more flexible than the redirection operators.
Unless the -append option is used, the file is newly created or overwritten.
With the -append option, the file is created if it does not exist, then the objects are appended to the file.
Creating vs writing to a new file
By default, out-file creates a file (as does the redirection operator >). Using -append, content is added to a file (if the file exists). Otherwise, -append also creates the file.