﻿function Get-TrimedPath
{
    param (
    [String] [Parameter(Mandatory = $true)]
    $Path = ""
)

    Write-Verbose "Entering Method Get-TrimedPath"

    $Path = $Path.Trim().Trim("""").Trim().Replace("/","\\").Trim("\")
    if($Path -ne "")
    {
        $Path = ".\" + $Path + "\"
    }
    else
    {
        $Path = ".\"
    }

    Write-Verbose "Leaving script Get-TrimedPath"

    return $Path
}
﻿function Get-TrimedPath
{
    param (
    [String] [Parameter(Mandatory = $false)]
    $Path = ""
)

    Write-Verbose "Entering Method Get-TrimedPath"

    $Path = $Path.Trim().Trim("""").Trim().Replace("/","\\").Trim("\")
    if($Path -ne "")
    {
        if(-not [System.IO.Path]::IsPathRooted($Path))
        {
            $Path = ".\" + $Path + "\"
        }
        else
        {
            $Path = $Path + "\"
        }
    }
    else
    {
        $Path = ".\"
    }

    Write-Verbose "Leaving script Get-TrimedPath"

    return $Path
}
Fix for epmty path and absolute paths
Fix for epmty path and absolute paths

If a path is empty "Get-TrimedPath" will return ".\"
Added logic to get absolute paths working
