@@ -755,7 +755,7 @@ function Test-TAEFService
755
755
}
756
756
757
757
# Double-check the TAEF service is known as a service as far as Windows is concerned
758
- $service = Get-Service | Where-Object {$_.Name -eq " TE.Service" }
758
+ $service = Get-Service - ErrorAction SilentlyContinue | Where-Object {$_.Name -eq " TE.Service" }
759
759
if ([string ]::IsNullOrEmpty($service ))
760
760
{
761
761
Write-Host " TAEF service...Not Installed"
@@ -812,7 +812,7 @@ function Install-TAEFService
812
812
813
813
$args = ' /install:TE.Service'
814
814
$output = Run- Process $path $args
815
- $service = Get-Service | Where-Object {$_.Name -eq " TE.Service" }
815
+ $service = Get-Service - ErrorAction SilentlyContinue | Where-Object {$_.Name -eq " TE.Service" }
816
816
if ([string ]::IsNullOrEmpty($service ))
817
817
{
818
818
Write-Host " Install TAEF service...Failed"
@@ -845,7 +845,7 @@ function Uninstall-TAEFService
845
845
$filename = Get-TAEFServiceImagePath
846
846
$args = ' /remove:TE.Service'
847
847
$output = Run- Process $filename $args
848
- $service = Get-Service | Where-Object {$_.Name -eq " TE.Service" }
848
+ $service = Get-Service - ErrorAction SilentlyContinue | Where-Object {$_.Name -eq " TE.Service" }
849
849
if (-not ([string ]::IsNullOrEmpty($service )))
850
850
{
851
851
Write-Host " Uninstall TAEF service...Failed"
@@ -870,7 +870,7 @@ function Start-TAEFService
870
870
}
871
871
872
872
$ok = Start-Service ' TE.Service'
873
- $service = Get-Service | Where-Object {$_.Name -eq " TE.Service" }
873
+ $service = Get-Service - ErrorAction SilentlyContinue | Where-Object {$_.Name -eq " TE.Service" }
874
874
if ($service.Status -ne " Running" )
875
875
{
876
876
Write-Host " Start TAEF service...Failed"
@@ -893,7 +893,7 @@ function Stop-TAEFService
893
893
return $false
894
894
}
895
895
896
- $service = Get-Service | Where-Object {$_.Name -eq " TE.Service" }
896
+ $service = Get-Service - ErrorAction SilentlyContinue | Where-Object {$_.Name -eq " TE.Service" }
897
897
if ($service -eq $null )
898
898
{
899
899
return ' NotFound'
@@ -902,7 +902,7 @@ function Stop-TAEFService
902
902
{
903
903
$ok = Stop-Service ' TE.Service'
904
904
}
905
- $service = Get-Service | Where-Object {$_.Name -eq " TE.Service" }
905
+ $service = Get-Service - ErrorAction SilentlyContinue | Where-Object {$_.Name -eq " TE.Service" }
906
906
if ($service -eq $null )
907
907
{
908
908
return ' NotFound'
0 commit comments