I have created a powershell script below to use in SAM, but I'm getting an error about psftp.exe not being a valid cmdlet or program. I have verified that psftp.exe is in the Windows\System32 folder on the SAM server.
$outfile = “testfile”
$strUN = “username”
$strPW = “password”
$strSRV = “servername.company.com”
$strBatchFile = “batch.psftp”
“DateTime: $(get-date -format MMddyyHHmmss)” | out-file $outfile -force -Encoding ASCII
“put $outfile`nrm $outfile`nbye” | out-file $strBatchFile -force -Encoding ASCII
[void] (psftp.exe -l sftpmon -pw sftpm0n servername.company.com -b batch.psftp -be)
$r = $?
if( $r -eq 'TRUE' ) { write-host "Available: Yes" }
if( $r -eq 'False' ) { write-host "Available: No" }
Any ideas?
TIA