Write PowerShell Script - Fast turnaround needed

Job ID: 33193756

Budget: $30 – $250 USD

I am looking for a PowerShell Professional to quickly write a script as explained below. I need this within a few hours. Here's a description of what the script should do. This script will be executed on Windows Server 2016 & 2019 only.

1. Query the IP address of the server and save it as a variable
2. Scan all subfolders of D:\usr\comp\ for a file with name "dispworker.exe" and list all full paths as array.
If the file exist, do:
3. For each occurrence of the file from step 2, run the command "D:\usr\comp\PATH\dispworker.exe -version" and extract 2 specific strings from it. Then write a csv file with the output: IP address, full path to file, string 1, string 2.
Else, do:
4. Search all subfolders of D:\usr\comp\ for a file with name "otherworker.exe" and list all full paths as array.
If any occurrence of "otherworker.exe" exist, do:
5. For each occurrence of the file from step 2, run the command "D:\usr\comp\PATH\otherworker.exe -version" and extract 2 specific strings from the output. Then write a csv file with the output: IP address, full path to file, string 1, string 2.

Due to security guidelines, we cannot provide access to our servers, and hence this script needs to be written and tested entirely on the freelancer's machine. We can test-run the script for you and get back with the results.
Related categories: Windows Server Powershell