From 3cf21419379282c75160054ac9d5713b05ddf7cf Mon Sep 17 00:00:00 2001 From: anamnavi Date: Wed, 27 Aug 2025 11:29:58 -0400 Subject: [PATCH] Ensure repository.xml file is created before referencing it in Dynamic parameter set up --- src/code/PublishPSResource.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/code/PublishPSResource.cs b/src/code/PublishPSResource.cs index 524e86ae1..f7f1237de 100644 --- a/src/code/PublishPSResource.cs +++ b/src/code/PublishPSResource.cs @@ -122,6 +122,9 @@ public PSCredential ProxyCredential { #region DynamicParameters public object GetDynamicParameters() { + // Create a respository story (the PSResourceRepository.xml file) if it does not already exist (i.e on a new machine without PSGet) + RepositorySettings.CheckRepositoryStore(); + PSRepositoryInfo repository = RepositorySettings.Read(new[] { Repository }, out string[] _).FirstOrDefault(); if (repository is not null && repository.ApiVersion == PSRepositoryInfo.APIVersion.ContainerRegistry) {