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
  • I can't use Powershell Toolkit with Studio 2015...

    I have modified the default modules to accept Studio version to be used in the "Add-Type" path, so that I can easily test the toolkit with 2011, 2014 or 2015 version (installed on the same machine).... and while it works just fine when run with 2014 (the Sample Roundtrip script runs successfully), when run with 2015, all I get is a bunch of errors.

    I'm not a developer (this .NET sh*t is a reall HELL), so I don't have a clue what is that crap telling me...

    SDL EXPERTS - it's your product, so be so kind and tell me what's wrong.
    According to $PSVersionTable I should be running PS 4.0... Win7 x64 with .NET Framework installed in all versions you can think of...

    And - when are you going to update the toolkit to work out-of-the-box with recent Studio version (so that it's actually USEFUL to anyone willing to start with it)?!

  • Hi Evzen,

    I think you only need to modify a couple places.

    In TMHelper.psm1 change the function New-FileBasedTM to the following:

    function New-FileBasedTM
    {
    	param([String] $filePath,[String] $description, [String] $sourceLanguageName, [String] $targetLanguageName, 
    		[Sdl.LanguagePlatform.TranslationMemory.FuzzyIndexes] $fuzzyIndexes, 
    		[Sdl.LanguagePlatform.Core.Tokenization.BuiltinRecognizers] $recognizers,
                    [Sdl.LanguagePlatform.Core.Tokenization.TokenizerFlags] $tokenizers,
                    [Sdl.LanguagePlatform.TranslationMemory.WordCountFlags] $wordCountFlags)
    	
    	
    	$sourceLanguage = Get-CultureInfo $sourceLanguageName;
    	$targetLanguage = Get-CultureInfo $targetLanguageName;
    
    	[Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory] $tm = 
    	New-Object Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory ($filePath,
    	$description, $sourceLanguage, $targetLanguage, $fuzzyIndexes, $recognizers, $tokenizers, $wordCountFlags);	
    }

     

    Then in Sample_Roundtrip.ps1, modify line 16 as follows:

    New-FileBasedTM $tmFilePath "Created by PowerShell" "en-US" "de-DE" $indexes $recognizers 7 4;

    # 7 and 4 are the defaults

     

    Long story short, the constructor found below has two more parameters (8 in total) in Trados Studio 2015 (in previous versions there were only 6 parameters). So the code above needs to be modified like the above to work.

    Let me know if that works for you.

  • Thanks a lot, Jesse!
    So, in other words, the toolkit is damn outdated and the owner of the project apparently doesn't care about it :(
    Which is quite surprising, given the big buzz there was about the toolkit's release...
    The toolkit project is completely dead. Obviously, the crazy .NET technique doesn't attract people as much as SDL was claiming... and I'm not wondering, it's TERRIBLY complicated, comparing to COM used in Trados 2007!
  • I think the reality is most developers use C# and not powershell so there hasn't been as much focus on it.

    But we'll add the update to our list of things to do. I see new plugins every week from developers doing their own thing but to be honest you are the only person I'm aware of using the powershell toolkit at all.

    Now I know somebody does we'll update it!

    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

  • Yes, as Paul already mentions, you can do everything powershell toolkit does in C#, and with C# you get to use Visual Studio which helps tremendously with productivity, so powershell toolkit took a back seat.

    Having said that, Microsoft is really pushing powershell, you might of heard how they release the code to be open source and you can even run it on Linux and OS X now. Also, powershell integrates with pretty much all Microsoft products, so while there is an initial learning curve, there is a lot of benefit learning powershell.
  • +1 to powershell, I'm successfully using it with Studio 2015, is not that bad once you get accustomed to it, and it was quite quick in integration on a non-microsoft web platform. C# for sure offers a whole more control over what it gets done and error catching, and the C# SDL api part is well done and documented.

    I'd love anyway an officially updated version of the SDL PS toolkit.
  • You're right most developers use C# but some others, like me, are using VB. Could be wonderful have also a VB reference.
    Regards
    Luca
Reply Children
No Data