Question: I have to query 400+ servers to find the business applications/services installed,there is no need for all the default services.

I obtained a list of services from a default system and put those in a **csv** file, but it doesn't seem to want to exclude them. Here is what I have so far:

```
{$excludelist = "c:\powershell\service_name.csv"
get-service -ComputerName servername -Exclude $excludelist
| Out-File C:\PowerShell\services.txt}

```

Answer: 
You have to return something from `setRutine`, probably the promises result:

```
 return await countUsers() /*...*/

```
Thank you for all your answers, you all helped me a little to understand better my problem and Doug Stevenson was right I changed the setRutine function to return a Promise instead of being an async function. 

I post the code:

```
function setRutine(nameF) {
    return new Promise( (resolve, reject) => {
        if(nameF == "countUsers") {
            return countUsers().then((count) => {
                resolve(count);
            }).catch((error) => {
                reject(error);
            })
        }
    });
}

```