Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convert-ChildPath parameter tostring[] forJoin-Path cmdlet#24677

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@ArmaanMcleod
Copy link
Contributor

@ArmaanMcleodArmaanMcleod commentedDec 15, 2024
edited
Loading

PR Summary

Converted-ChildPath parameter tostring[] forJoin-Path cmdlet.

PR Context

Fixes#21367

Allows user to give an array of child paths with-ChildPath. This avoids the extra usage with-AdditionalChildPath which can be ignored and makes usage ofJoin-Path easier.

This was discussed to be bucket 3 breaking change.

Example

>Join-Path-Path'one'-ChildPath'two','three'one\two\three

PR Checklist

mklement0 and 0xfeeddeadbeef reacted with hooray emoji
@iSazonov
Copy link
Collaborator

@ArmaanMcleod Since it is a breaking change I suggest to wrap this in an experimental feature (you can find examples in our code). Then I can review and merge since it is already approved by WG.

ArmaanMcleod reacted with thumbs up emoji

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot removed the Review - NeededThe PR is being reviewed labelMar 10, 2025
@ArmaanMcleod
Copy link
ContributorAuthor

@iSazonov Interesting. I thought since it was accepted as bucket 3 breaking change it would not need an experimental feature. I did not see that requirement in the issue.

In any case would be good to move this along so I will create an experimental feature for this.

What should the experimental feature be called?

iSazonov reacted with thumbs up emoji

@iSazonov
Copy link
Collaborator

Although it's a bracket 3, it's still abreaking change. The experimental feature allows us to minimize risks and get feedback faster.
Name could bePSJoinPathChildArray. You can see examples withGet-ExperimentalFeature cndlet.

ArmaanMcleod reacted with thumbs up emoji

@ArmaanMcleod
Copy link
ContributorAuthor

@iSazonov This one actually doesn't make much sense to enable experimental feature, since we are changing the type ofChildPath fromstring tostring[]. We can't have a parameter type change be wrapped in experimental feature.

@iSazonov
Copy link
Collaborator

iSazonov commentedMar 15, 2025
edited by unfurl-linksbot
Loading

We can't have a parameter type change be wrapped in experimental feature.

We haveExperimentalAttribute. Seehttps://github.com/daxian-dbw/PowerShell/blob/d12230f1888ea0226df0e4e0e2e0de2f9e8c0a1e/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs

GitHub
PowerShell for every system. Contribute to daxian-dbw/PowerShell development by creating an account on GitHub.
ArmaanMcleod reacted with eyes emoji

@ArmaanMcleod
Copy link
ContributorAuthor

ArmaanMcleod commentedMar 15, 2025
edited
Loading

@iSazonov Thats really interesting. However even if you do:

[Experimental(ExperimentalFeature.PSJoinPathChildArray,ExperimentAction.Show)]publicstring[]ChildPath{get;set;}

How do you also make the previous parameter:

publicstringChildPath{get;set;}

Also show when the experimental feature is disabled? in C# we can't have two properties have the same name but different type. Maybe I am misunderstanding how this works...

@iSazonoviSazonov added CL-BreakingChangeIndicates that a PR should be marked as a breaking change in the Change Log CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log PowerShell-Docs neededThe PR was reviewed and a PowerShell Docs update is needed labelsMar 15, 2025
@iSazonov
Copy link
Collaborator

in C# we can't have two properties have the same name but different type.

Yes, it would be too tricky wrap in experimental feature. Let's leave as is.

ArmaanMcleod reacted with thumbs up emoji

}
@{
Path='one'
ChildPath= [string]::Empty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We need one more test for empty collection.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This should already be covered here:

@{
Path='one'
ChildPath=@()
ExpectedResult="one${sepChar}"
}

iSazonov and 0xfeeddeadbeef reacted with thumbs up emoji
@iSazonoviSazonov self-assigned thisMar 15, 2025
@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonoviSazonov merged commit48c34fc intoPowerShell:masterMar 18, 2025
38 of 40 checks passed
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-servicebot commentedMar 18, 2025
edited by unfurl-linksbot
Loading

📣 Hey@ArmaanMcleod, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗https://aka.ms/PSRepoFeedback

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@iSazonoviSazonoviSazonov approved these changes

@daxian-dbwdaxian-dbwAwaiting requested review from daxian-dbw

@adityapatwardhanadityapatwardhanAwaiting requested review from adityapatwardhan

@SteveL-MSFTSteveL-MSFTAwaiting requested review from SteveL-MSFT

Assignees

@iSazonoviSazonov

Labels

CL-BreakingChangeIndicates that a PR should be marked as a breaking change in the Change LogCL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change LogPowerShell-Docs neededThe PR was reviewed and a PowerShell Docs update is needed

Projects

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Make Join-Path parameter -ChildPath accept an array

2 participants

@ArmaanMcleod@iSazonov

[8]ページ先頭

©2009-2025 Movatter.jp