'Azure Automation power shell

I am running the power shell script below in Azure Automation runbook , the script goes to on prem file share and rename file names replace strings. Script runs fine in Powershell IDE , I wanted to run from ADF or Azure Automation ,I am new to Azure Automation what are the things I have to do to make this run successfully in Azure automation see screen shot below enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source