none
PowerShell - Envio de arquivo FTP RRS feed

  • Pergunta

  • Eu criei o script abaixo para o envio de arquivos através do ftp, mas quando executo recebo o erro

    $mes= Get-Date -Format "MMdyyyy"
    $dir = "C:\XP\XP.Automate.CMTIMS.TH\Temp\$mes\*.*"
    $ftp = "ftp://xx:xxxxxx*@xxxx.****.br/xxxxx/xxxx/"

    "ftp url: $ftp"

    $webclient = New-Object System.Net.WebClient
    $uri = New-Object System.Uri($ftp)

    "Uploading $File..."

    $webclient.UploadFile($uri,$dir)

    ERRO:

    Cannot find an overload for "UploadFile" and the argument count: "1".
    At C:\XP\XP.Automate.CMTIMS.TH\FTP.ps1:22 char:1
    + $webclient.UploadFile($dir)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest



    Carlinhos IT

    sexta-feira, 31 de julho de 2015 12:19

Respostas

Todas as Respostas