Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows PowerShell Support #140

Open
smetroid opened this issue Aug 28, 2020 · 3 comments
Open

Windows PowerShell Support #140

smetroid opened this issue Aug 28, 2020 · 3 comments
Labels
feature-request Feature Request

Comments

@smetroid
Copy link

Hello,

Great tool, use it on my MacOS and Linux environment, now I am trying to use it with PowerShell/Windows. I can create new commands entries, however when it comes to pet exec the default shell is dos(cmd.exe) and not PowerShell. Still good enough to save the the crazy PowerShell commands I have to remember, however it would be nice to have it execute the command as well.

Thanks in advance. If you can guide me through where to make the changes/updates, I can make changes, test, and make a PR if anyone could else would be interested.

--
Enrique

@RamiAwar
Copy link
Collaborator

Hey Enrique! I can look into this for you and guide you through it :)

Right now we have a file called util_windows.go (and util_unix.go), these define the run function which is used to actually execute the command in question. We'd want to somehow create an alternative run that uses powershell I'm guessing.

We'd either have to:

  1. Change the run signature to also accept the 'shell type' from somewhere. Maybe we can get this from the shell itself (some way to detect if we're running in powershell) or somewhere else idk.
  2. Create a global config flag that decides which shell to use. That means you're limited to using either powershell or cmd until you change your global pet config.

I think the global config option is way easier to implement and less disruptive. I'd go for that as a first step if I were you!

And we might have to update the 'selection' as well potentially, not sure about that one.

@RamiAwar RamiAwar added the feature-request Feature Request label Feb 19, 2024
@smetroid
Copy link
Author

Thanks for your response on this @RamiAwar ... I've moved away from PowerShell at the moment, but I am sure this would still be a nice feature for some other people who are working with PowerShell.

I can close this ticket if I need to, or I can leave it open to be referenced in a PR.

@RamiAwar
Copy link
Collaborator

I see, yeah no worries! Yeah let's keep it open, I think it's easy to implement and I'll probably get to it later!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants