Can someone help me add a catch statement ? so if a server on the servers.txt file does not have a SQL service
for the output to show the machineName and "N/A" or something relevant .. so I want the output to basically
tell me which servers on the list have a SQL service and which ones do not.
$Computers = Get-Content C:\PS\Servers.txt
Get-Service *sql* -ComputerName $Computers | select Name,status,machineName | sort machineName | Format-Table -autosize
I want to output to a CSV