Suppress error messages
This commit is contained in:
parent
4ff12aae01
commit
f3eb4ec970
1 changed files with 2 additions and 2 deletions
|
@ -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'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue