SDL PowerShell Toolkit

SDL is pleased to announce the availability of a beta version of the SDL PowerShell Toolkit.

The SDL PowerShell Toolkit is a set of modules using Windows PowerShell scripting technology and the Project Automation and Translation Provider APIs from the SDL Trados Studio Professional SDK. In a nutshell, the modules provide functions and sample code that you can re-use in your PowerShell scripts to automate SDL Trados Studio. They feature an initial set of code for use in typical Studio automation tasks such as creating a project, a translation memory or a package derived from a project. You can use these as a starting point for your own PowerShell-based efforts. It is assumed that the reader is familiar with Windows PowerShell as well as an initial understanding of the SDL Trados Studio SDK, in particular the project automation API.

Over time, we would like to see the development community develop further modules and helpful functions that we can share with each other.

Best regards, Ian

Ian Davies | Senior Product Manager | SDL | Language Technologies Division | +44 7826843819

Paul Filkin | RWS Group

________________________
Design your own training!

You've done the courses and still need to go a little further, or still not clear? 
Tell us what you need in our Community Solutions Hub

PowerShellToolkit.zip
Parents Reply Children
  • Thanks Patrik. I got it working by using add-type -language CSharp

  • Hi Patrik

    I need a little help with this... Got a nice little script that will automate package-generation, but: it always fails with "license check failed, with Exception Sdl.Core.FileCheck.FileCheckException: Unknown Error"

    The error occurs at "CheckLicense() => LicenceCheckWithoutUsingNetworkSeat.get_License" when doing a Get-Project. This doesn't quite make sense as we do have license server in the network, and Studio itself is working.

    How I can I get this going?

    TIA

    Markus

  • Hi,

    are you running it as 32 or 64 bit?

    Studio is 32 bit only and some of the licensing components will fail if you run as 64 bit.

    Regards

    Patrik

  • Hi

    I'm running 64bit, but I'm launching powershell in 32bit-mode. The problem was intermittent, after a reboot it's mostly gone... Very strange.

    Off to the next challenge ;)

    I'm now successfully creating a packagee from a project, but I need to include the analysis-reports for the target-language.

    Any hints on how to enable this? Or do I have to manually copy the reports into the resulting sdlppx (zip)?

    Thanks a lot for your help.

    Markus

  • Hi

    OK, I also got around this, sort of.

    Next, bigger issue:

    I want to have new project-TMs created upon package creation, hence I set:

    $packageOptions.ProjectTranslationMemoryOptions = [Sdl.ProjectAutomation.Core.ProjectTranslationMemoryPackageOptions]::CreateNew;

    However, as soon as this option is enabled, I don't get any project-translation-memories at all.

    The parameter itself is valid and should work, since setting it to "UseExisting" results in attached project-TMs (most of the time), so it's got to be some hidden magic?

    If somebody could shed some light on this issue, I'd be very grateful.

    Best regards

    Markus

  • Hi

    I'm working on project creation.

    I've been able to get translation memories objects from my server, and i've been able to create a filebased project.

    What I need to do is to create a filebased project with server-based TMs. I couldn't find anything in the examples provided and seems the modules just manage filebased tms.

    I've tried to modify the existing modules in several ways but so far i couldn't get it to work right. I'm still learning the environment and seems i'm not skilled enough to do that.

    Any help from this community?

    Thank you very much in advance...

    Enrico

  • Hi Enrico

    I suppose you've already given the TMServerHelper.zip from Luis Lopes in post #4 a try, and your problem is now that the "New-Project" cmdlet only takes a path to a TM as a parameter?

    Judging from this entry in the API documentation, you should be able to rewrite it to take a Uri as param "$pathToTMs" instead of a string, and you should be fine.

    Good luck
    Markus

    P.S.: There doesn't seem to be a lot of activity here, unfortunately, so don't expect to get answers fast.

  • Hi Markus,

    I gave it a try and yes, the issue is kinda that (there's a function to get the target language from a memory filepath inside the projecthelper that's not "server-ready").

    The page you pointed me at should anyway be helpful. I'll try to apply it and post my results.

    Is there any "update" i should issue after modifying a module? Or it should just take any modification right-away? (I mean specifically changing arguments of a function)

    Thank you very much!

    Enrico

    PS: I'm lucky: I got a very fast answer ;-)

  • Hi Enrico

    Well, you got a fast answer, but it's just from another lost soul in the SDL SDK space ;)

    From what I've learned so far, you should restart your application to make sure the updated modules are loaded.

    Depending on when you load the modules, that may not even be necessary. Ex: I have written a small application with a drag'n'drop window, that let's you create a package by dropping a .proj file in it; when the module loading/unloading happens on-event, it will reload the modules on every file dropped. For efficiency's sake I rewrote it later to only load/unload the modules on start/stop of the entire application.

    Best regards

    Markus

  • Yeah it worked! you don't know how happy I am ;-). Thank you Markus for the hint. It pointed me to the right direction!

    As for changes the module while developing, you just have to use the "-force" option in import-module and it will get reimported every time with the modifications to the .psm1 file.

    I wrote a little web-broker connected to powershell in order to interface it to our in-house management system.