Join Path URI
Zuletzt geändert: 14.03.2026 05:56

Join-PathUri #

ÜBERSICHT #

Verbindet eine Basis-URI und einen relativen Pfad.

SYNTAX #

Join-PathUri [[-Base] <string>] [[-Path] <string>] [<CommonParameters>]

BESCHREIBUNG #

Entfernt automatisch überflüssige Slashes und verbindet beide Pfade sauber. Unterstützt explizit leere Basis-Pfade (Home-Verzeichnis) und Root-Pfad ‘/’.

PARAMETER #

-Base #

Type: string
Default: ''

Basis-URI (z.B. “/api” oder “”).

-Path #

Type: string
Default: ''

Angehängter Pfad (z.B. “/inbox”).

AUSGABEN #

string

Kombinierte URI.

BEISPIELE #

# Ausgabe: "test.txt"
Join-PathUri -Base "" -Path "test.txt"
# Ausgabe: "test.txt"
Join-PathUri -Base '' -Path '/test.txt'
# Ausgabe: "/test.txt"
Join-PathUri -Base '/' -Path 'test.txt'
# Ausgabe: "/test.txt"
Join-PathUri -Base '/' -Path '/test.txt'
# Ausgabe: "test/test.txt"
Join-PathUri -Base 'test' -Path 'test.txt'
# Ausgabe: "test/test.txt"
Join-PathUri -Base 'test' -Path '/test.txt'
# Ausgabe: "/test/test.txt"
Join-PathUri -Base '/test' -Path '/test.txt'
# Ausgabe: "/test/test.txt"
Join-PathUri -Base '/test' -Path 'test.txt'