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
  • Some of the scripts in the modules folder are pointing to: 'C:\Program Files' - you will need to amend these to: 'C:\Program Files (x86)' if you are running Studio on a 64-bit machine.

    Thanks
    Fas

     

    Fas Aziz | Desktop Life Cycle Service Manager | SDL | Support Operations, Support Lifecycle

  • Is it possible to provide an example of this using server based rather than file based TMs?

    Cheers

    Hugh

  • Hi Markus,

    were you able to identify the magic behind the $packageOptions.ProjectTranslationMemoryOptions = [Sdl.ProjectAutomation.Core.ProjectTranslationMemoryPackageOptions]::CreateNew;

    Even though I make sure to save the project before creating the new packages, I get an "<Messages Level="Warning" Message="No main translation memories found to create project translation memories from for language pair English (United States)->Korean (Korea)." Source="Populate Project Translation Memories" />" inside the sdlppx's sdlproj file.

    Even the "UseExisting" is not working for me, there are just no TMs in the packages.

    Regards,

    Jan

  • Well, about those Project TMs in packages: could you please try setting TranslationProviderConfiguration.OverrideParent to true?

    Seems to be working for me :-)

    Jan

  • Hi Jan

    What I found out so far:

    CreateNew seems to work only if you have $packageOptions.RecomputeAnalysisStatistics = $true;.

    Then again, I had error messages about "could not create instance of translation provider sdltm.https://...." which in turn happens because the integrated Windows-auth does not work with providers in that format "sdltm.https://....", it seems the "sdltm." has to be removed.

    I resolved that by adding a local SDL-user on our server which is added in the script through

    $project.Credentials.AddCredential("sdltm.https://<URI>:443",$false,"user","pass");

    After opening the project-File, of course.

    In short: you have to work around a lot of quirks in those libs, it seems...

    Regards
    Markus

  • Hello, still writing here, although I suspect this hasn't much to do with powershell, but with updated SP2 API.

    Since I upgraded to SP2, projects with file-based TM comes out without any TM configured. I tried using the original example provided but with the same result as my code.

    Projects with server-based TM gets configured correctly. This line:

    $entry = New-Object Sdl.ProjectAutomation.Core.TranslationProviderCascadeEntry ($tmPath, $true, $true, $true);

    gives me an empty object wether $tmPath is a Correct path string or a Translation Provider Reference as per this page:

    producthelp.sdl.com/.../Index.aspx

    Should I install an updated SDK? Is there any release Notes about API in SP2?

    Thank you!

  • Unknown said:

    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.

    Has this ever been clarified/solved? I'm now having exactly the same problem...

    I got the new project TMs being created only if I also set the "IncludeReports" option (newly introduced in Studio 2015 CU7) to True.

    It seems to me like if this option doesn't control only including reports, but rather works as a global "DO include / DON'T include stuff" switch... which would point to either incorrectly documented API, or incorrectly working API.

    Anyone can comment on this?

  • Hello?! Anyone in there?!
    Am I being deliberately ignored with my (presumably unpleasant) discoveries?
  • Hello Evzen,

    We have added an item of work to look at powershell and see what needs to be done to ensure it works correctly with the latest versions of the products. If I'm really honest this doesn't have a very high priority as there are many other things waiting at the top of the tree which affect more users and there are other ways to handle the problems most of the time. But we do appreciate that not everyone wants to use C# and some are more comfortable with a scripting tool.

    A good starting point would be for us to identify the things, in a single line or two, that need to be done so they don't get lost in long threads. This is something we'll come back to so we can agree with you, and if anyone else is having problems with them too, so we can prioritise in case the effort is substantial.

    So to answer your question we are listening, but are just not in a position to do anything about them in the very near future. I think I did ask you a while ago whether we might be able to help by resolving some of these things for you in a different way as this could be a good stop gap... but you didn't respond?

    Regards

    Paul

    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

  • Paul, it is obvious that most (if not all) of the issues recently reported by me have nothing to do with PowerShell itself. PowerShell is just the way to use the API. Moreover, I have commented in quite a few threads where the same issues were reported by people NOT using PowerShell.
    Show me working C# code which does NOT show the buggy behavior to prove that the problem is PowerShell...

    Regarding your previous offer - perhaps I did not post the answer after all, since it was quite pointless... because you obviously failed to get the point of the discussion :-\.
    So, in short - I need to be able to automate EVERY basic engineering operation (creating project, running tasks, creating packages, importing packages, creatingTMs, updating TMs, etc.) from commandline.

    And in fact I'm already very close to have it already done using the PowerShell Toolkit... but the terrible bugs in either API or Studio itself are preventing me from getting it finished - memory hogs causing OutOfMemory exceptions, options not working as documented, etc.

    So you should better invest the effort in fixing the bugs instead of developing some funny single-purpose application which would be full of new bugs anyway...

  • Hello Evzen,

    The reason I asked again is because fixing this is something that will require core development, so finding a workaround is going to be the best approach if we want something quickly.

    We do have a list of things we have already raised with the development team that need to be fixed, some which you have probably come across already and some which you won't. We, and by "we" I mean the team that supports developers, don't set the priorities for core development so we can escalate them (and we do) but they still have to fit within other priorities. So we find workarounds where we can.

    If I look at your default project template issue. Why can't you use a named project template for example? If you do that then the API performs correctly and using your example will honour the excel settings to ignore worksheet names. If you make that your default it still works. So is this a major problem for you to work around this problem in this way?

    Regards

    Paul

    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

  • Just to add to this. I discussed this again with Romulus just now and he is going to take a better look at this this week to identify where the problem is exactly. Then either find a workaround, if there is one, or just make sure we raise the awareness of this problem again with the development team to try and get it fixed.

    In the meantime it would be helpful to just understand why you need to use the default for command line scripts and can't use a specified template?

    Thank you

    Paul

    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

Reply
  • Just to add to this. I discussed this again with Romulus just now and he is going to take a better look at this this week to identify where the problem is exactly. Then either find a workaround, if there is one, or just make sure we raise the awareness of this problem again with the development team to try and get it fixed.

    In the meantime it would be helpful to just understand why you need to use the default for command line scripts and can't use a specified template?

    Thank you

    Paul

    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

Children
No Data