Public/Nuget/Paket/Get-PaketPath.ps1
function Get-PaketPath { [CmdletBinding()] param ( [string]$Path="." ) begin { } process { $paketDirectoryInfo = (Get-Item $Path).Directory if (!$paketDirectoryInfo){ $paketDirectoryInfo = Get-Item $Path } $paketDependeciesFile = "$($paketDirectoryInfo.FullName)\.paket\paket.exe" while (!(Test-Path $paketDependeciesFile)) { $paketDirectoryInfo = $paketDirectoryInfo.Parent if (!$paketDirectoryInfo){ return } $paketDependeciesFile = "$($paketDirectoryInfo.FullName)\.paket\paket.exe" } $item=Get-Item $paketDependeciesFile Set-Location $item.Directory.Parent.FullName $item } end { } } |