Using Get-location to provide only the path

Get-location provides the current path we are working

PS C:\Users\HP> get-location


How can we get only the Path like ‘C:/Users\HP’

Have you at least tried to look for an answer yourself? :face_with_diagonal_mouth:

Get-Location | Select-Object -ExpandProperty Path
$Location = Get-Location
1 Like

You can also use the automatic variable $pwd for this: