The more forums i look on, the more confused i get, and i've found very similar posts, but not exactly what i'm looking for, i'm a powershell newbie, can someone tell me the best way of being able to write this in powershell.
I can get the program to launch but it's passing the parameters and the syntax i'm struggling with. To make it easier to read i have removed any formatting from the $programArgs command so i'm hoping it's just putting in the correct synatax around it.
This is what i have so far:-
$program = "C:\Program Files (x86)\PuTTY\psftp.exe"
$programArgs = "-pw 1234 -P 10023 -i D:\sftp\Keys\mykey.ppk [email protected] -b d:\sftp\Scripts\GetAll.txt"
Invoke-Command -ScriptBlock { & $program $programArgs }