Test the Machine Translation Service Application with PowerShell

Test the Machine Translation Service Application with PowerShell

The Machine Translation Services Service Application is a Service Application that allows users and developers to translate not only sites, but their content as well to other languages. The Machine Translation Services is interacted through APIs, and the users do not have a “Translate Document” button, unless of course, their developers created a custom action for them.

Test the Machine Translation Service Application with PowerShell

As a SharePoint IT Professional, I don’t want to write code simply to test a Service Application. Luckily, PowerShell is there for us! By using PowerShell, we can convert a document from Word to PDF, and test that this service application is working properly!

To test the Machine Translation Service Application works properly, you can run a PowerShell script that uses CSOM to call the required functions. We have created the sample script below.

We first have to get the URL of the site where the document is stored, as well as get the username and password of the user who will request the translation.

We then need to get the current document location in the $input variable, and the new document location in the $output variable

Next up, we connect to our site using CSOM, and start the translation job.

If we put it all together it looks like this:

If it finishes sucesfully and you see your  new document, you know what your Machine Translation Service Application works, and you can now let your developers create custom solutions to take benefit from this Service Application.

 

Did you find this article useful?

If yes, you will love Deploying SharePoint 2016: Best Practices for Installing, Configuring, and Maintaining SharePoint Server 2016 written by myself, and SharePoint Server MVP Trevor Seward! Get it now at the links below!
4.7/5 (10)

Please rate this

 
Comments

This script will help me a lot. Thank You!

Leave a Reply