Closed lprichar closed 5 years ago
I'm really torn with with PR as on one hand we currently have no support so anythings an improvement on that but I don't think this counts as cross platform as it ignores so much core functionality.
It's really just executing a process?
It's executing the pwsh
process, which is how you run powershell scripts on a Mac afaik. I feel like this solves 90% of scenarios. It certainly solves mine, and is an improvement over something like StartAndReturnProcess("pwsh")
which doesn't read as nicely, and isn't cross platform.
btw I looked into solving the underlying "InvalidProgramException: Invalid IL code" error, but didn't make much progress. It appears that the RunspaceFactory.CreateRunspace
command is fundamentally not cross platform.
Its the best solution we have so far, so I'll leave this open and see if anyone joins the conversation.
What do you need in order to merge and publish it? Can you please provide specifics?
Yes, please add this. I also looking for this. In case of linux the pwsh
should be executed instead of powershell
.
@lprichar : Just wanted to check how did you get past the error when cake trying to load this power shell add in (which is mentioned in issue #12 ). Could not load Addins/Cake.Powershell.0.4.7/lib/net46/System.Management.Automation.dll (missing Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35))
I'm sorry @laxmanrapolu I don't recall getting that error. Maybe because I had .Net Core installed or was running in WSL it wasn't a problem for me?
Thanks for the update @lprichar . WSL could be the reason why you did not see error as I have .net core too. I couldn't get past this error to make cake work in Linux containers. We use lot of Powershell scripts that cake uses, so trying some other alternatives now.
Summary
Introduces the ability to run powershell scripts on mac and linux per Issue #12. Supports Arguments and WorkingDirectory.
Limitations
To Test
hello.ps1
like:Expected: "Hello Mr Bob Dobalina"