Suppress error messages

This commit is contained in:
Manuel Thalmann 2024-03-20 16:55:19 +01:00
parent 4ff12aae01
commit f3eb4ec970

View file

@ -11,11 +11,11 @@ $null = New-Module {
[System.Collections.Generic.List[string]] $profiles = @(); [System.Collections.Generic.List[string]] $profiles = @();
if (Get-Command pwsh) { if (Get-Command pwsh -ErrorAction SilentlyContinue) {
$profiles.Add($(pwsh -c '$PROFILE')); $profiles.Add($(pwsh -c '$PROFILE'));
} }
if (Get-Command powershell) { if (Get-Command powershell -ErrorAction SilentlyContinue) {
$profiles.Add($(powershell -c '$PROFILE')); $profiles.Add($(powershell -c '$PROFILE'));
} }