Powershell: Join-Path should accept an array of -ChildPath

Created on 5 Oct 2018  路  6Comments  路  Source: PowerShell/PowerShell

When building long paths in a cross-platform way (and particularly if we're not sure of the provider), it would be very useful to be able to avoid chaining multiple calls to Join-path (which is currently a common practice).

I propose changing the -ChildPath parameter to accept a string array and be ValueFromRemainingArguments

And then iterate over the values and produce one long path.

Area-Cmdlets-Management Resolution-Answered

Most helpful comment

Yeah, I thought @dlwyatt already implemented this.

All 6 comments

Isn鈥檛 that what AdditionalChildPath is for?

Yes, it accepts value from remaining argument too... 馃
@Jaykul ?

Yeah, I thought @dlwyatt already implemented this.

Did not see that. Can live with that 馃槉

For what it is worth the documentation is broken, the parameter is not in the syntax section currently. Odd as I added it some time ago.

Was this page helpful?
0 / 5 - 0 ratings