What is sync-cmd.exe? … the output does not look like a normal output - it looks like an error. You may redirect the error stream of the app to the standard stream to be able to capture it.
… and you should use either one - variable assignment OR Out-Null … not both! ![]()