0

I came across this answer while researching this issue and I can get the script to run. But I have no idea how to pass arguments to my script (It's expecting 4 arguments).

I also need to capture its output as it emits a list of HEX color codes on completion.

Is this possible?

This is what I have:

# Using -Raw, read the file in full, as a single, multi-line string.
$DcolorsScript = Get-Content -Raw ./shellscripts/dcolors.sh

# !! The \-escaping is needed up to PowerShell 7.2.x
wsl bash -c ($DcolorsScript -replace '"', '\"')
2
  • Nestin different shells is seldom a good idea, as there are lots of IO issues. How about if you either use Bash or Powershell for the whole thing instead? Commented Sep 5, 2023 at 5:25
  • 1
    Yeah, I actually decided to re-code the whole function in Python. My intentions were a bit misguided. Sorry. Commented Sep 5, 2023 at 5:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.