Let's say you have a full path of type string. E.g. the automatic variable $profile
write-host "Your PowerShell profile path is: " $profile
Your powershell profile path is: C:\Users\Zuga\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
This is how you get the parent directory of that path:
$parent= split-path $profile -Parent
write-host "Parent directory is: " $parent
Parent directory is: C:\Users\Zuga\Documents\WindowsPowerShell