mirror of
https://github.com/cemu-project/vcpkg.git
synced 2024-11-24 11:49:41 +00:00
18 lines
513 B
PowerShell
18 lines
513 B
PowerShell
[CmdletBinding()]
|
|
param(
|
|
[ValidateNotNullOrEmpty()]
|
|
[Parameter(Mandatory=$true)][string]$startingDir,
|
|
[ValidateNotNullOrEmpty()]
|
|
[Parameter(Mandatory=$true)][string]$filename
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$currentDir = $startingDir
|
|
|
|
while (!($currentDir -eq "") -and !(Test-Path "$currentDir\$filename"))
|
|
{
|
|
Write-Verbose "Examining $currentDir for $filename"
|
|
$currentDir = Split-path $currentDir -Parent
|
|
}
|
|
Write-Verbose "Examining $currentDir for $filename - Found"
|
|
return $currentDir |