Restart-ExchangeServices.psm1

<#
.SYNOPSIS
    Restarts running Microsoft Exchange services on the server.
.DESCRIPTION
    Restarts running Microsoft Exchange services on the server.
.EXAMPLE
    Restart-ExchangeServices
.NOTES
    Version : 0.0.2
    Created by : asheroto
    Date Coded : 2021-02-04
.LINK
    GitHub Repo: https://github.com/asheroto/Restart-ExchangeServices
#>

function Restart-ExchangeServices {
    $services = Get-Service | ? { $_.name -like "MSExchange*" -and $_.Status -eq "Running"}
    foreach ($service in $services) {Restart-Service $service.name -Force}
}