Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell upload a file via new-webserviceproxy

$
0
0

Hi,

I am a great fan of powershell, and use the new-webserviceproxy all the time to connect to the webservice for one of our tools (CA Service Desk). BUT.... I am now trying to upload a file, so there is a method called .CreateAttachment, but you first have to attach the file to the connection. they are talking about DIME, and show examples in VB .Net or Java

is it possible to achieve this with powershell too ? 

my script is as simple as:

$usd = new-webserviceproxy -url http://blablablabl.wsdl
$sid = $usd.login("username", "password")

here has to happen the "magic" with the attachment

$usd.CreateAttachment($sid,handle to document server, handle to ticket, "Document name","c:\link\to\file\myfile.txt")

here is the example that they gave for Visual Basic .Net

Dim reqContext As SoapContext = objUSD_WS.RequestSoapContext
Dim dimeAttach As New DimeAttachment("image/gif",TypeFormat.MediaType, "c:\test.txt")
reqContext.Attachments.Add(dimeAttach)

strResult = objUSD_WS.createAttachment(sid, "doc_rep:1002","cr:400001", "my desc", "c:\test.txt")

I have not been able to find out how to do this in powershell....

who can help me ??




Viewing all articles
Browse latest Browse all 15028

Trending Articles



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