automation

Hi all, I have to study something to automate some tasks. Let's say that, for example, I want to create a script that Is able to call the synchronization of a connector or, for example, to assign some system role to an identity. Is there a way to do it via powershell script or other programming language?