1

Powershell を介してリモート トランスコーディング サーバーで ffmpeg を呼び出そうとしています。

$session = new-pssession -computername transcodingserver
Invoke-Command -session $session -scriptblock { powershell ffmpeg }

ffmpeg はリモート サーバーに正しくインストールされており、そこで実行できますが、リモート呼び出しでエラーが発生します。

ffmpeg : The term 'ffmpeg' is not recognized as the name of a cmdlet, function, script file, or operable program.
    + CategoryInfo          : NotSpecified: (ffmpeg : The te...rable program. :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : transcodingserver

Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ffmpeg
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (ffmpeg:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
NotSpecified: (:) [], RemoteException

私が実行しているマシンが、Invoke-Commandそこにインストールされていないffmpegを実行しようとすると、私には思えます。リモートサーバーでffmpegを実行するには、何をしなければなりませんか?

4

2 に答える 2

2

それ自体がpowershellセッションであるため(一時的なものではありますが)、powershell内部は必要ありません。実行可能ファイルへのフルパスを見つけて、次を実行します-scriptblock {..}Invoke-Commandffmpeg

$session = new-pssession -computername transcodingserver
Invoke-Command -session $session -scriptblock { & "C:\Program Files\ffmpeg\bin\ffmpeg.exe"}

または、コマンドなしで直接コマンドを実行できますnew-pssession

Invoke-Command -ComputerName transcodingserver -scriptblock { 
    & "C:\Program Files\ffmpeg\bin\ffmpeg.exe"}
于 2014-06-06T14:26:38.027 に答える