@@ -257,15 +257,13 @@ Describe 'Test Save-PSResource for PSResources' {
257257 # Save module that is not authenticode signed
258258 # Should FAIL to save the module
259259 It " Save module that is not authenticode signed" - Skip:(! (Get-IsWindows )) {
260- Save-PSResource - Name $testModuleName - Version " 5.0.0" - AuthenticodeCheck - Repository $PSGalleryName - TrustRepository - Path $SaveDir - ErrorAction SilentlyContinue
261- $Error [0 ].FullyQualifiedErrorId | Should - be " InstallPackageFailed,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource"
260+ { Save-PSResource - Name $testModuleName - Version " 5.0.0" - AuthenticodeCheck - Repository $PSGalleryName - TrustRepository - Path $SaveDir } | Should - Throw - ErrorId " GetAuthenticodeSignatureError,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource"
262261 }
263262
264263 # Save 1.4.4.1 (with incorrect catalog file)
265264 # Should FAIL to save the module
266265 It " Save module with incorrect catalog file" - Skip:(! (Get-IsWindows )) {
267- Save-PSResource - Name $PackageManagement - Version " 1.4.4.1" - AuthenticodeCheck - Repository $PSGalleryName - TrustRepository - Path $SaveDir - ErrorAction SilentlyContinue
268- $Error [0 ].FullyQualifiedErrorId | Should - be " InstallPackageFailed,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource"
266+ { Save-PSResource - Name $PackageManagement - Version " 1.4.4.1" - AuthenticodeCheck - Repository $PSGalleryName - TrustRepository - Path $SaveDir } | Should - Throw - ErrorId " TestFileCatalogError,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource"
269267 }
270268
271269 # Save script that is signed
@@ -282,8 +280,7 @@ Describe 'Test Save-PSResource for PSResources' {
282280 # Save script that is not signed
283281 # Should throw
284282 It " Save script that is not signed" - Skip:(! (Get-IsWindows )) {
285- Save-PSResource - Name " TestTestScript" - Version " 1.3.1.1" - AuthenticodeCheck - Repository $PSGalleryName - TrustRepository - ErrorAction SilentlyContinue
286- $Error [0 ].FullyQualifiedErrorId | Should - be " InstallPackageFailed,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource"
283+ { Save-PSResource - Name " TestTestScript" - Version " 1.3.1.1" - AuthenticodeCheck - Repository $PSGalleryName - TrustRepository } | Should - Throw - ErrorId " GetAuthenticodeSignatureError,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource"
287284 }
288285
289286<#
0 commit comments