Recently we got an interesting support request where a customer wanted to prepare the application settings, which are usually available in the Royal TS UI through View -> Options, using a logon script in PowerShell.

I thought it would be a good idea to share this in a blog post because there are one or two caveats to watch out for but first, here’s the script:

# import the powershell module to get access to the cmd lets
Install-Module -Name RoyalDocument.PowerShell -Scope CurrentUser -Force
Get-Module -Name RoyalDocument.PowerShell | Format-Table Name, Version
Import-Module -Name RoyalDocument.PowerShell

# create a store
$store = New-RoyalStore -UserName $Env:USERNAME

# set all the options
$store.Options.DontShowDocumentModifiedNotification = $true
$store.Options.DontShowMaintenanceExtensionNotification = $true
$store.Options.DontShowRestoreConnectionsDialog = $true
$store.Options.DoNotCreateDashboardOnStartup = $true
$store.Options.DoNotShowGettingStartedPageOnStartup = $true
$store.Options.SuperStartPageBehavior = 0
$store.Options.AutoStartDocumentMode = 3
$store.Options.WelcomeWindowLicenseAgreementVersion = 999
$store.Options.WelcomeWindowUpdateCheckAndFeatureTrackingVersion = 999

# here we need an array of strings with the full path to all the docs we want to open automatically
$store.Options.AutoStartDocumentList = @( "FullDocumentPath1", "FullDocumentPath2" )

# this saves settings
Out-RoyalDocument -Document $store.ApplicationDocument

The above script sets only a subset of the available options. To find more options, visit: https://content.royalapplications.com/Help/RoyalTS/V5/index.html?scripting_objectproperties_royalapplicationsetting.htm

Previous Post Next Post