Код: Выделить всё
windows-latest
Код: Выделить всё
wg.exe: D:\a\_temp\ae4190e7-b6d1-448e-8238-0af82213defe.ps1:4
Line |
4 | wg.exe genkey | Tee-Object server_keys/test0_private.key | wg.exe pub …
| ~~~~~~
| The term 'wg.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.
Error: Process completed with exit code 1.
< /code>
Здесь я вручную пытался создать клавиши, но это то же самое при выполнении в коде Python. Затем я изменился на. \ Wg.exe
Код: Выделить всё
Invoke-WebRequest -Uri "https://download.wireguard.com/windows-client/wireguard-installer.exe" -OutFile ".\wireguard-installer.exe"
Start-Process -FilePath '.\wireguard-installer.exe'
Код: Выделить всё
def _gen_server_keys(self):
command = f"cd \"{self.path}\" | .\\wg.exe genkey | " \
f"Tee-Object \"server_keys\\{self.name + '_privet.key'}\" | " \
f".\\wg.exe pubkey | " \
f"Tee-Object \"server_keys\\{self.name + '_public.key'}\""
self._execute_command(command)
@staticmethod
def _execute_command(command):
completed_process = subprocess.run(
["powershell.exe", "-Command", command],
capture_output=True,
text=True,
)
print(completed_process.stderr)
return completed_process
< /code>
Также здесь действий рабочего процесса и репозитория GitHub. wg.exe
Подробнее здесь: https://stackoverflow.com/questions/797 ... b-workflow