You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to replace some simple powershell scripts with dotnet-script so that I can expand them using C# syntax. The scripts execute some external exes, which in powershell is very succinct and similar to a simple batch file, but with C# the most succinct seems to be Process.ExecuteAsync which is still harder for others to follow than a simple call to the exe with all it's arguments.
I wonder if there could be a new magic command to do it, something like:
Thinking about it, I realised that the # commands are actually pre-processor commands so it wouldn't really work to have them as special commands in the middle of C# (and might look a bit odd!). I've also realised that the ExecuteAsync command doesn't make you put the command line parameters as completely separate parameters
I'd like to replace some simple powershell scripts with dotnet-script so that I can expand them using C# syntax. The scripts execute some external exes, which in powershell is very succinct and similar to a simple batch file, but with C# the most succinct seems to be
Process.ExecuteAsync
which is still harder for others to follow than a simple call to the exe with all it's arguments.I wonder if there could be a new magic command to do it, something like:
#run xcopy C:\somefolder E:\backupfolder /D /E /C /R /H /I /K /Y
compared with how it would currently look:
I guess I could simplify it a bit by making a shared script that took a single string as an Arg and split it to run
Process.ExecuteAsync
The text was updated successfully, but these errors were encountered: