You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR prevents users from explicitly setting ApiVersion to Unknown when using the Set-PSResourceRepository cmdlet. The Unknown value is reserved for internal use when the system cannot automatically determine a repository's type, and allowing users to set it explicitly would create non-functional repositories.
Problem
Previously, users could set a repository's ApiVersion to "unknown":
Set-PSResourceRepository-Name "MyRepo"-ApiVersion "unknown"# This would succeed but make the repository unusable
When a repository has ApiVersion.Unknown, cmdlets like Find-PSResource and Install-PSResource detect this and throw errors indicating the repository type is not supported, making the repository completely non-functional.
Changes
Code Changes
src/code/SetPSResourceRepository.cs: Added validation to throw a clear error when users attempt to set ApiVersion to Unknown, with a helpful message listing the valid values (V2, V3, Local, NugetServer, ContainerRegistry)
Test Changes
test/ResourceRepositoryTests/SetPSResourceRepository.Tests.ps1: Updated the test to verify that attempting to set ApiVersion to "unknown" now throws the expected error and leaves the repository unchanged
New Behavior
Set-PSResourceRepository-Name "MyRepo"-ApiVersion "unknown"# Now throws: "ApiVersion 'Unknown' is not a valid value for Set-PSResourceRepository. # Valid values are: V2, V3, Local, NugetServer, ContainerRegistry"
All other ApiVersion values continue to work as expected.
CopilotAI
changed the title
(削除) [WIP] Remove ability to set API version to unknown (削除ここまで)
(追記) Prevent users from setting ApiVersion to 'Unknown' in Set-PSResourceRepository (追記ここまで)
Oct 8, 2025
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Summary
This PR prevents users from explicitly setting
ApiVersiontoUnknownwhen using theSet-PSResourceRepositorycmdlet. TheUnknownvalue is reserved for internal use when the system cannot automatically determine a repository's type, and allowing users to set it explicitly would create non-functional repositories.Problem
Previously, users could set a repository's ApiVersion to "unknown":
When a repository has
ApiVersion.Unknown, cmdlets likeFind-PSResourceandInstall-PSResourcedetect this and throw errors indicating the repository type is not supported, making the repository completely non-functional.Changes
Code Changes
ApiVersiontoUnknown, with a helpful message listing the valid values (V2, V3, Local, NugetServer, ContainerRegistry)Test Changes
New Behavior
All other ApiVersion values continue to work as expected.
Fixes
Closes #1878
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
1k9vsblobprodcus379.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)37cvsblobprodcus359.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)4myvsblobprodcus32.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)51yvsblobprodcus36.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)5dkvsblobprodcus355.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)7devsblobprodcus323.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)7k6vsblobprodcus337.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)7tjvsblobprodcus341.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)bcnvsblobprodcus378.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)c50vsblobprodcus330.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)c78vsblobprodcus322.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dlbvsblobprodcus316.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)fdpvsblobprodcus345.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)gbsvsblobprodcus365.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)kh4vsblobprodcus325.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)kmuvsblobprodcus389.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)l49vsblobprodcus358.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)m6xvsblobprodcus342.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)pkvvsblobprodcus321.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)s4uvsblobprodcus326.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)tphvsblobprodcus375.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)dotnet restore --ignore-failed-sources(dns block)uy6vsblobprodcus34.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)yttvsblobprodcus357.vsblob.vsassets.io/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.