如何使用巧克力将软件安装到远程计算机?

How do Install software to a remote computer using chocolatey?

我已经在我的本地机器上安装了 chocolatey,我想使用 powershell 远程安装软件,如果我能得到任何帮助,我将不胜感激。

invoke-command -ComputerName $remotemachine -Credential (Get-Credential) -ScriptBlock {install choco same way as local}

invoke-command -ComputerName $remotemachine -Credential (Get-Credential) -ScriptBlock {choco install package xyz}
或通过 New-PSSession?

启动与远程客户端的会话