By defining Microsoft PowerShell functions within PowerShell modules, you can organize your scripts, avoid duplicating code, ...
Take advantage of Azure Functions to run small pieces of code that can be triggered by events in the Azure cloud. Azure Functions is the serverless compute offering in the Microsoft Azure cloud.