<p>Vous pouvez utiliser la classe .NET <a href="https://learn.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=netframework-4.8">Path</a> :</p>
<pre><code class="lang-auto">[IO.Path]::Combine('C:\', 'Foo', 'Bar')
</code></pre>
<p>Remarque : cela ne fonctionnera pas pour les valeurs commencant par une barre oblique inverse, comme les <a href="https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths">chemins UNC</a></p>