Run PowerShell on Linux and Mac
PowerShell is a scripting Language by Microsoft that is built on top of .Net Framework to manage complex tasks like automating tasks related to Servers like SharePoint, exchange, Office 365 and more. With few lines of this scripting language you can achieve target.
Microsoft has made it possible to run PowerShell outside Windows OS
To Run it on Linux and PowerShell check those links
For the macOS:
for Linux:
To Learn more about PowerShell