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
$originalXmlFilePath=Join-Path-Path $powerShellGetPath-ChildPath "PSResourceRepository.xml"#this is the temporary PSResourceRepository.xml file created in the 'BeforeAll' section of this test file
# Publish-PSResource should create PSResourceRepository.xml file if not present. It will register the 'PSGallery' repository as a default, so this test will still fail
168
+
# But we can ensure the PSResourceRepository.xml file is created.
$err[0].FullyQualifiedErrorId | Should -Be "RepositoryNotRegistered,Microsoft.PowerShell.PSResourceGet.Cmdlets.PublishPSResource"
174
+
175
+
$registeredRepos=Get-PSResourceRepository
176
+
$registeredRepos.Count| Should -Be 1
177
+
$registeredRepos[0].Name | Should -Be $script:PSGalleryName
178
+
179
+
# Cleanup
180
+
# Remove the new PSResourceRepository.xml file created by the Publish-PSResource command and put back the original created in the 'BeforeAll' section of this test file
$err[0].FullyQualifiedErrorId | Should -BeExactly "ModulePrefixParameterIncorrectlyProvided,Microsoft.PowerShell.PSResourceGet.Cmdlets.PublishPSResource"
529
+
}
530
+
531
+
It "not Publish a resource when ModulePrefix is provided without Repository parameter" {
$err[0].FullyQualifiedErrorId | Should -BeExactly "ModulePrefixParameterProvidedWithoutRepositoryParameter,Microsoft.PowerShell.PSResourceGet.Cmdlets.PublishPSResource"
539
+
}
540
+
518
541
It "Publish a package given NupkgPath to a package with .psd1" {
0 commit comments