Thanks for the reply @Highboy.
The Run Power shell scritp action only has the following code:
$variableName = "variableValue"
Write-Output $variableName
On my computer
OS Name Microsoft Windows 10 Pro
Version 10.0.19042 Build 19042
The weirdest thing is I don't have any issues when I connect to my remote machine and with my credentials I am able to run everything with:
OS Name Microsoft Windows Server 2016 Datacenter
Version 10.0.14393 Build 14393
As you said @Highboy, I reused the code of another flow, and at a certain point it gave me a error reading a file. Deleted the code in the action and pasted the above code.