Pages

6/28/2013

Using PLINK through Powershell

Using PLINK through Powershell
$User = 
$Pswd = 
$Computer = 
$plink = \plink.exe"
$plinkoptions = " -v -batch -pw $Pswd"

$cmd1 = '/usr/sbin/vdf -h'
$remoteCommand = '"' + $cmd1 + '"'
$command = $plink + " " + $plinkoptions + " " + $User + "@" + $computer + " " + $remoteCommand

$msg = Invoke-Expression -command $command 
$msg

No comments: