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.

  • 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
  • Hi Paul,

    as I mentioned few years ago, the problem is that you are completely ignoring powerusers (able to SCRIPT their tasks in VBScript/JScript, which, believe it or not, are still alive and strongly kickin'!) and it looks like you believe that everybody on this planet is a developer with Visual Studio installed :(

    I'm really wondering if your API activities are really intended to help Trados Studio USERS... It seems more like it's actually intended to ease the life of YOUR OWN DEVELOPERS - because instead of fixing bugs or adding helpful _engineering_ features you just say "you have the API, develop it yourself"...
    This attitude would be okay if Trados Studio is free and/or opensourced, but is totally twisted in case of awfully expensive software (remember, we are talking about Pro version at least, not anything below).

    Since - as I also mentioned previously - I'm a scripting guy, wanting to have MACHINES performing repetitive tasks from automatic SCRIPTS (not HUMANS clicking repetitively manually on ridiculous GUI buttons in some damned plugins!), not a developer, this damned powershell toolkit (with all it's damned .net weirdness and ridiculous verbosity) seems to be the only way these days... after you abandoned the COM API :(

    BTW, COM API can be still very well used these days, just look at Microsoft Office! Still being updated, still being extensively used by a lot of people around the world... not only using the built-in VBA, but also externally using COM API!
    It's all about developers not being lazy to add a few pieces of code in the application, so that the COM is exposed!

    And before you say "well, but COM allows you to use only the last installed vesion" (registered in system, to be precise), which is something I've also heard - that's totally irelevant, since with your latest Studio 2015 licensing you basically destroyed the option to have legally multiple vesions installed... unless one is VERY rich and spends fortune for network license...
    So this argument is pointless...
  • Stack Overflow is probably the biggest developer community in the world and according to them C# (which implies .NET) is quite popular amongst their community. More about that here.

    I completely agree that the toolkit didn't receive any attention recently but this is also why we decided to make the toolkit completely open-source. This doesn't mean we are not going to do any changes to the toolkit but we're no longer the only ones who can make any change. More details about open sourcing the SDL Studio Powershell toolkit here.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

  • Jesse, Microsof tis pushing PowerShell _FOR ADMINITRATIVE TASKS_... and yes, it does make sense in such cases... But it's VERY unfriendly to normal users or powerusers.
    Is it so difficult to understand that USERS simply DO NOT WANT to learn C# and bloated Visual Studio?!?! Especially if they are used to do their stuff in JScript/VBScript for years?!
    It looks like that for developers it really is... :(
  • A pitty indeed! I've been able to do marvellous things with the SDK of Trados 2007 and AutoHotkey through COM objects but won't have the time to learn a full programming language on the go to use the Studio APIs.
  • While being a user of the PS Toolkit, I think learning C# (along with VS and .net and everything) is worth the effort for a professional LSP. I also understand SDL position as stated by Romulus regarding Powershell, since it's fairly used among SDL devs and not very reliable. Also I think it wouldn't be very convenient for SDL to spread their effort on multiple languages. Being able to learn and expand/move to new languages and platforms is a key factor for a developer nowadays and has to be taken in account when budgeting time and expenses for developers.

    As for scripting (meaning invoking repeated actions automatically) for sure a sort of macro system implemented in trados could be nice. But IMHO it's not programming, it's something different and shouldn't be confused.
  • Thanks for your supporting words, Raphaël!
    Good to know that I'm not alone in this almost hopeless 'fight' with stubborn programmers :-\
Reply Children
No Data