Helpers/Get-BuildSolutionName.ps1
<#
.SYNOPSIS Get the Visual Studio solution name. #> function Get-BuildSolutionName { [CmdletBinding()] [OutputType([System.String])] param ( # Root path of the target module [Parameter(Mandatory = $true)] [System.String] $BuildRoot ) $solutionName = Get-ChildItem -Path $BuildRoot -Directory | Where-Object { Test-Path -Path ('{0}\{1}.sln'-f $_.FullName, $_.Name) } | Select-Object -ExpandProperty 'Name' -First 1 if (-not [System.String]::IsNullOrEmpty($solutionName)) { Write-Output $solutionName } } |