If you want to run PowerShell scripts from Azure on the VM itself you will need to use a Hybrid Worker Group:
https://zcusa.951200.xyz/en-us/azure/automation/automation-hybrid-runbook-worker?sharingId=MVP_307251
You can create this in a Azure Automation Account. Once you created the account you can then create this hybrid runbook worker group. You will need to create a group for every machine you want to run seperate scripts on.
Once that is done you can run a runbook (PowerShell script) on this worker group:
https://zcusa.951200.xyz/en-us/azure/automation/automation-hrw-run-runbooks?sharingId=MVP_307251
You can then create a schedule in the azure automation account. Here you can specify to run the script at specific times in on the hybrid worker group