Land-PullRequest: WriteError, remove some Invoke-Expressions to raw calls, fix NativeCommandError check