Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Parameter problem with plink and PowerShell

$
0
0

I am trying to ssh into a switch using plink, but I keep getting errors with my parameters.

Powershell
$plink='C:\Program Files (x86)\PuTTY\plink.exe'$switch="172.20.19.50"$commands="c:\scripts\cmd.txt"$username=Read-Host"User name"$pw=Read-Host-Prompt"Enter password"-AsSecureString$plink-l$username-pw$pw-m$commands-ssh$switch

These are the errors I am getting:

Powershell
Youmustprovideavalueexpressionontheright-handsideofthe'-'operator.Atline:7char:8Unexpectedtoken'l'inexpressionorstatement.Atline:7char:9Unexpectedtoken'username'inexpressionorstatement.Atline:7char:11Unexpectedtoken'-pw'inexpressionorstatement.Atline:7char:21Unexpectedtoken'pw'inexpressionorstatement.Atline:7char:25Unexpectedtoken'-m'inexpressionorstatement.Atline:7char:29Unexpectedtoken...

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>