Suppress error messages

This commit is contained in:
Manuel Thalmann 2024-03-20 16:55:19 +01:00
parent f15ebf73a9
commit 142aa56f2f

View file

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