Powershell script to Upload log file from local system to http URL -


how upload log file local system webpage (http://abc..) using powershell script? in advance

if using http, try this:

    $sourcefilepath = "c:\mylocalfolder\locallogfilename.log"     $siteaddress = "http://192.168.15.12/destinationfolder"     $urldest = "{0}/{1}" -f ($siteaddress, "destinationlogfilename.log";     $webclient = new-object system.net.webclient;     $webclient.credentials = new-object system.net.networkcredential("myusername", "mypassword");     ("*** uploading {0} file {1} ***" -f ($sourcefilepath, $siteaddress) ) | write-host -foregroundcolor green -backgroundcolor yellow     $webclient.uploadfile($urldest, "put", $sourcefilepath); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -