Suppress error messages
This commit is contained in:
parent
f15ebf73a9
commit
142aa56f2f
|
@ -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'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue