Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/code/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,7 @@ internal static bool CheckAuthenticodeSignature(
// Because authenticode and catalog verifications are only applicable on Windows, we allow all packages by default to be installed on unix systems.
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
cmdletPassedIn.WriteWarning("Authenticode check cannot be performed on Linux or MacOS.");
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ Describe 'Test Install-PSResource for V2 Server scenarios' -tags 'CI' {
$err[0].FullyQualifiedErrorId | Should -BeExactly "GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource"
}

# Test that AuthenticodeCheck parameter displays warning on non-Windows
It "Install with AuthenticodeCheck on non-Windows should display warning" -Skip:(Get-IsWindows) {
Install-PSResource -Name $testModuleName -Repository $PSGalleryName -TrustRepository -AuthenticodeCheck -WarningVariable warn -WarningAction SilentlyContinue
$warn[0] | Should -Contain "Authenticode check cannot be performed on Linux or MacOS"
$res = Get-InstalledPSResource $testModuleName
$res.Name | Should -Be $testModuleName
}

# Unix test for installing scripts
It "Install script resource - Unix only" -Skip:(Get-IsWindows) {
# previously installing pester on Unix was throwing an error due to how the environment PATH variable was being gotten.
Expand Down
Loading