新项目的PowerShell命令意外失败

时间:2015-11-19 23:34:20

标签: powershell

任何人都可以看到为什么这个方法创建一个目录在脚本中工作了几次但是,我最后一次调用它失败了,我看不到输出?没有错误,也没有看到Dir $path结果。

结果是我的git clone失败了。

    _create_folder -path $destinationPath

    "$NL Downloading clone of repository ...." 
    git clone $repoAddress $destinationPath
    Dir $destinationPath

    "$NL Trying a repository pull ...." 
    git pull $repoAddress 

....

function _create_folder
{
    [CmdletBinding()]
    Param
    (
        [Parameter(Mandatory=$true)]
        [string]$path = ""
    )
    Begin {}
    Process
    {
        "$NL Creating $path ....."
        if(!(Test-Path -Path $path)) { 
            New-Item -ItemType Directory -Path $path -Verbose:$true
        }
        Dir $path
    }
}

0 个答案:

没有答案