How do I suppress standard error output in PowerShell?

前端 未结 5 2259
情深已故
情深已故 2020-12-29 05:06

In a PowerShell script automating some SVN tasks I have the following function:

function SvnUrlExists($url)
{
  svn info $url | out-null 2>&1
  return         


        
5条回答
  •  佛祖请我去吃肉
    2020-12-29 05:41

    The voted answer generates an error for me. The solution ended up being the following:

    cmd /c "MyProgram MyArguments 2>&1" | Out-Null
    

提交回复
热议问题