@@ -174,7 +174,7 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' {
174
174
}
175
175
176
176
It " Save script without using -IncludeXML" {
177
- Save-PSResource - Name $testScriptName - Repository $PSGalleryName - Path $SaveDir - TrustRepository | Should -Not - Throw
177
+ { Save-PSResource - Name $testScriptName - Repository $PSGalleryName - Path $SaveDir - TrustRepository } | Should -Not - Throw
178
178
179
179
$SavedScriptFile = Join-Path - Path $SaveDir - ChildPath " $testScriptName .ps1"
180
180
Test-Path - Path $SavedScriptFile - PathType ' Leaf' | Should - BeTrue
@@ -197,12 +197,13 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' {
197
197
It " Save module that is not authenticode signed" - Skip:(! (Get-IsWindows )) {
198
198
Save-PSResource - Name $testModuleName - Version " 5.0.0" - AuthenticodeCheck - Repository $PSGalleryName - TrustRepository - Path $SaveDir - ErrorVariable err - ErrorAction SilentlyContinue
199
199
$err.Count | Should - BeGreaterThan 0
200
- $err [0 ].FullyQualifiedErrorId | Should - BeExactly " InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource"
200
+ $err [0 ].FullyQualifiedErrorId | Should - Contain " GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource"
201
+ $err [1 ].FullyQualifiedErrorId | Should - Contain " InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource"
201
202
}
202
203
203
204
# Save resource that requires license
204
205
It " Save resource that requires accept license with -AcceptLicense flag" {
205
- Save-PSResource - Repository $TestGalleryName - TrustRepository - Path $SaveDir `
206
+ Save-PSResource - Repository $PSGalleryName - TrustRepository - Path $SaveDir `
206
207
- Name $testModuleName2 - AcceptLicense
207
208
$pkg = Get-InstalledPSResource - Path $SaveDir - Name $testModuleName2
208
209
$pkg.Name | Should - Be $testModuleName2
0 commit comments