26 lines
689 B
PowerShell
26 lines
689 B
PowerShell
function Resolve-ConfigurationDataProviderSettingsPath {
|
|
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]
|
|
$Provider,
|
|
|
|
[Parameter(Mandatory=$false)]
|
|
[AllowEmptyString()]
|
|
[string]
|
|
$SettingsPath
|
|
)
|
|
|
|
$FileName = "ProviderSettings.$Provider.psd1"
|
|
|
|
if([string]::IsNullOrWhiteSpace($SettingsPath)){
|
|
return (Join-Path -Path (Get-Location).Path -ChildPath $FileName)
|
|
}
|
|
|
|
if((Test-Path -Path $SettingsPath -PathType Container) -or $SettingsPath.EndsWith("\") -or $SettingsPath.EndsWith("/")){
|
|
return (Join-Path -Path $SettingsPath -ChildPath $FileName)
|
|
}
|
|
|
|
return $SettingsPath
|
|
}
|