阅读背景:

Powershell:如果“mkdir”命令存在文件alreadys,我怎么能抑制错误?

来源:互联网 
PS Y:\> mkdir  C:/dog


    Directory: C:\


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         11/7/2013  10:59 PM            dog


PS Y:\> mkdir  C:/dog
New-Item : Item with specified name C:\dog already exists.
At line:38 char:24
+         $scriptCmd = {& <<<<  $wrappedCmd -Type Directory @PSBoundParameters }
    + CategoryInfo          : ResourceExists: (C:\dog:String) [New-Item], IOException
    + FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.NewItemCommand
PS Y:\> mkdir  C:/dog


    Directory: C:\


Mo



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: