Skip to content

8/22/2023 PM Publish #10365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions reference/7.4/Microsoft.PowerShell.Management/Resolve-Path.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 04/21/2023
ms.date: 08/22/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/resolve-path?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Resolve-Path
Expand Down Expand Up @@ -123,13 +123,25 @@ PS C:\> Resolve-Path -LiteralPath 'test[xml]'
### Example 7: Resolve a path relative to another folder

This example uses the **RelativeBasePath** parameter to resolve the path of the `pwsh` executable
relative to `$env:TEMP`.
relative to `$env:TEMP`, returning the **System.Management.Automation.PathInfo** object for the
resolved path. When the command includes the **Relative** switch parameter, it returns a **String**
representing the relative path from `$env:TEMP` to the `pwsh` executable.

```powershell
$ExecutablePath = Get-Command -Name pwsh | Select-Object -ExpandProperty Source
Resolve-Path -Path $ExecutablePath -RelativeBasePath $env:TEMP
```

```Output
Path
----
C:\Program Files\PowerShell\7-preview\pwsh.exe
```

```powershell
Resolve-Path -Path $ExecutablePath -RelativeBasePath $env:TEMP -Relative
```

```Output
..\..\..\..\..\Program Files\PowerShell\7-preview\pwsh.exe
```
Expand Down Expand Up @@ -214,7 +226,10 @@ Accept wildcard characters: False
### -RelativeBasePath

Specifies a path to resolve the relative path from. When you use this parameter, the cmdlet returns
a string representing the relative path from **RelativeBasePath** to **Path**.
the **System.Management.Automation.PathInfo** object for the resolved path.

When you use this parameter with the **Relative** switch parameter, the cmdlet returns a string
representing the relative path from **RelativeBasePath** to **Path**.

This parameter was added in PowerShell 7.4.

Expand Down