File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
test/InstallPSResourceTests Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -2160,6 +2160,7 @@ internal static bool CheckAuthenticodeSignature(
21602160 // Because authenticode and catalog verifications are only applicable on Windows, we allow all packages by default to be installed on unix systems.
21612161 if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
21622162 {
2163+ cmdletPassedIn . WriteWarning ( "Authenticode check cannot be performed on Linux or MacOS." ) ;
21632164 return true ;
21642165 }
21652166
Original file line number Diff line number Diff line change @@ -554,6 +554,14 @@ Describe 'Test Install-PSResource for V2 Server scenarios' -tags 'CI' {
554554 $err [0 ].FullyQualifiedErrorId | Should - BeExactly " GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource"
555555 }
556556
557+ # Test that AuthenticodeCheck parameter displays warning on non-Windows
558+ It " Install with AuthenticodeCheck on non-Windows should display warning" - Skip:(Get-IsWindows ) {
559+ Install-PSResource - Name $testModuleName - Repository $PSGalleryName - TrustRepository - AuthenticodeCheck - WarningVariable warn - WarningAction SilentlyContinue
560+ $warn [0 ] | Should - Contain " Authenticode check cannot be performed on Linux or MacOS"
561+ $res = Get-InstalledPSResource $testModuleName
562+ $res.Name | Should - Be $testModuleName
563+ }
564+
557565 # Unix test for installing scripts
558566 It " Install script resource - Unix only" - Skip:(Get-IsWindows ) {
559567 # previously installing pester on Unix was throwing an error due to how the environment PATH variable was being gotten.
You can’t perform that action at this time.
0 commit comments