Skip to content

The IT Guys Support Blog

Supporting Southern New England Small & Mid-Size Businesses
  • Facebook
  • Email Support
  • Business Site
  • Facebook
  • Email Support
  • Business Site
Search Posts

Posted on March 27, 2025 | By ITGuy
PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
# Get-ServiceNames.ps1 [-ServicePattern 'screen']
#
# This script retrieves and displays a list of all services on the local machine,
#     including their service names, display names, and current statuses.
#
# NOTE FORMATTING IN ABOVE EXAMPLE -> screen is the text, and * are wildcards, and '' only needed if spaces.
#
 
param (
[string]$ServicePattern = '*'
)
 
# Retrieve all [matching] services
$services = Get-Service -ErrorAction SilentlyContinue |
 
# Filter services based on the display name pattern (case-insensitive)
Where-Object { $_.DisplayName -like $ServicePattern } |
 
# Select desired properties
Select-Object @{Name='ServiceName';Expression={$_.Name}}, DisplayName, Status
 
#Check if any services were found
if ($services) {
# Sort and display the services
$services | Sort-Object ServiceName | Format-Table -AutoSize
  } else {
Write-Host "No services found matching the pattern '$ServicePattern'."
}
Category: News

   Our Various Regional Facilities
















Administrivia

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Helpdesk Access

How to Manage Retainers, Tickets & Projects

1. Do everything on the web portal: Your Business Portal (for existing customers)
2. Create a Helpdesk Ticket: Submit Ticket Form (for existing customers)
3. Email: Support@ITGuys.Business (for future or existing customers)
4. Call us at: (860) 917-5346 to discuss how we can make you even more secure and successful! (everyone!)
5. Finally, the Contact Us page here.

Main Business Site is here!

Click the shamrock to email us!

The Home Computer

Copyright 2025 The IT Guys Support Blog