Open tuananh opened 2 years ago
Hi there!
As far as I know, nobody is working on this.
If someone volunteers, I'd be glad to support them and answer questions.
Here's my suggestions:
pssession
, then support is already complete. Simply enable the provider for non-Windows systems, verify pssession
works, and update the docs to explain how to use it.powershell.go
replace newPowerShell()
is what needs to change. @tlimoncelli thank you. lemme try it to see if it works.
if not, maybe i can dive into it.
If you do dive in, here's a start. I split out the Windows vs. non-Windows code: https://github.com/StackExchange/dnscontrol/pull/1733
Friendly ping? Would love to see if this is possible.
@tlimoncelli sorry I don't have the capacity to do this at the moment. Maybe someone else can jump it?
No worries! I'm just pinging old tickets.
I'm going to close this issue. There doesn't seem to be demand for this feature. If new demand appears, we can re-open this issue.
@tlimoncelli
No worries! I'm just pinging old tickets.
I'm going to close this issue. There doesn't seem to be demand for this feature. If new demand appears, we can re-open this issue.
Hi there!
I've hacked around to try to make it works "as is" and took another approach influenced by https://github.com/profesorfalken/jPowerShell (I don't know if what follows matches with what you had in mind at that time but here it is 😄 )
By looking at their code I saw in https://github.com/profesorfalken/jPowerShell/blob/master/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L55 (and https://github.com/profesorfalken/jPowerShell/blob/master/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L130) that they can shellout PowerShell commands to any PowerShell CLI installed and discovered that a Linux version of PowerShell exists (https://learn.microsoft.com/en-us/powershell/scripting/install/install-debian?view=powershell-7.3) (I didn't know that 🙄 )
So I installed PowerShell on my Debian 11, made a symlink between /usr/bin/pwsh
and /usr/local/bin/powershell.exe
(because it's hardcorded https://github.com/bhendo/go-powershell/blob/master/shell.go#L31) and disabled OS check in dnscontrol
https://github.com/StackExchange/dnscontrol/blob/fa890063a18fb97470b1b4b47318e016bc2b5b85/providers/msdns/msdnsProvider.go#L49-L52
But still, it doesn't work... The command hangs forever (and never timeout).
I suspect it's due to how things are escaped as it runs on Linux and might be linked to https://github.com/StackExchange/dnscontrol/pull/1733
But before going any further I wanted to see with you if it was the way to go.
Thank you! 👍
Edit:
It should also works on MacOS : https://stackoverflow.com/a/70421665
To check that WinRM works (MacOS or Linux) :
powershell.exe -Command "New-PSSession -ComputerName server.ad.corp -Credential dnscontrol"
Yes! I think this is a good direction.
By the way... go-powershell is abandoned. We should either adopt something different, write our own, or fork go-powershell and make our own changes.
I just want to ask is this feature already implemented? Has anyone try this?