I am trying to run a 15 line code using Invoke Powershell. I can copy and paste this 15 line of code and not execute it because it misinterprets the code and gives me an error message. What possibilities are there to execute a programming code via invoke without reading it in and executing it via a read file? The code works fine via read file.
Could you let us know what is that you want to perform ? You did mention the code works fine by First Reading the file and using it Invoke Powershell Activity.
Let us know what exactly is that your looking for.
Hello Crusha,
This video might help you: https://www.youtube.com/watch?v=wKZu86GzHOo
Just to give you an idea, this is how I implemented a script that sets the local settings in my VM with the following Invoke powershell activity:
To be honest I would not leave the powershell command text very open ended. Imagine the scenario where the powershell command is in a txt file in a shared drive and local robot users have quite extensive administrator privilages. In that case if a human user with or without bad intentions, edits that txt file and all your VM’s can be affected by that. In my case I designed in a way that the powershell is hardcoded inside the activity and a change can be implemented by publishing to the orchestrator. This command is not something we would change frequently anyway.
Best