Administrative Tasks Automation
You can use Microsoft's scripting language PowerShell to automate administrative tasks.
Additional Information About Microsoft PowerShell
Information and Help
Microsoft's PowerShell provides a scripting language which can be used for automating administrative tasks via Windows and Linux.
Here is some basic information and help about getting started:
Prerequisites for Innovator Automation
You must have at least PowerShell 7.4 or newer to be able to automate Innovator tasks.
Windows installation packages can be loaded via https://docs.microsoft.com/powershell/scripting/install/installing-powershell.
This page also contains Linux installation information.
The execution policy must enable execution of scripts (see https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies) to run on a Windows system.
Execution guidelines may vary from customer to customer. You can check this using the command:
Get-ExecutionPolicy -List
Innovator-PowerShell-Script-Library
The PowerShell scripts included within scope of delivery with Innovator are digitally signed by MID and can be be used with the policies "Unrestricted", "RemoteSigned" and "AllSigned".
The Innovator script library is installed with each client or server component installation. The functions provided check the existing rights in the user management, if these are applicable.
The script library for Linux systems has a reduced range of functions specific to Windows. The following are missing:
-
Get-InnoService
-
Set-InnoService
-
Start-InnoService
-
Stop-InnoService
-
Update-InnoDataDirectory
-
Export-InnoModelData
Basic Commands
-
Loading the Innovator Module
-
Alternative A: Generally with PSModulePath (see Microsoft: Basics of PSModulePath)
-
Create an MID.Innovator.PowerShell directory in the desired module directory (e.g. in C:\Program Files\WindowsPowerShell\Modules)
-
Run as administrator in a Windows command prompt:
mklink /J "<module directory>\MID.Innovator.PowerShell\16.1" "C:\Program Files\Innovator\16.1"
-
-
Alternative B: Explicitly at the start of every script
Import module 'C:\Program Files\Innovator\16.1\mid.innovator.powershell.psd1'
-
-
List all available commands
Get-Command -Module mid.innovator.powershell
-
Get help and examples of a command
Get-Help Get-InnoLicenseServer -Detailed
Examples
-
List all managed models
Get-InnoLicenseServer -InoHost <license server>.16100 | Get-InnoManagedModel
-
List of all model versions with formatting as table
Get-InnoLicenseServer -InoHost <license server>.16100 | Get-InnoManagedModelVersion | Format-Table
-
List of all managed models, grouped according to managed model
Get-InnoLicenseServer -InoHost <license server>.16100 | Get-InnoManagedModelVersion | Select-Object -Property Name, Version, Type, IsRunning | Sort-Object -Property Name, Version, Type | Format-Table -GroupBy Name
-
List of all model abc* back-ups not currently running
Get-InnoLicenseServer -InoHost <license server>.16100 | Get-InnoManagedModelVersion -ModelName abc* | Where-Object{($_.IsRunning -eq $false) -and ($_.Type -eq 'Backup')}
-
Start all model abc* back-ups of back-ups not currently running
Get-InnoLicenseServer -InoHost <license server>.16100 | Get-InnoManagedModelVersion -ModelName abc* | Where-Object{($_.IsRunning -eq $false) -and ($_.Type -eq 'Backup')} | Start-InnoManagedModelVersion
-
List of all resource constraints for managed models
Get-InnoManagedModel -InoHost <license server>.16100 | Get-InnoResourceQuota
-
List of all locally set-up Innovator agent services
Get-InnoService -ServiceProgram inoagent
-
Set all locally set-up Innovator agent services to "manual"
Get-InnoService -ServiceProgram inoagent | Set-InnoService -StartType Manual
Searching for Model Elements
Commands and Parameters
Use the commandlet (Cmdlet) Find-InnoModelElements to search for all model elements in model versions and independent models.
It is provided for the model version or standalone model via the pipeline.
Enter the name of the name of the saved search you want to use in the Name parameter.
Enter the EnableModelWide parameter if you want to use the search model-wide.
Enter the EnableUserSpecific parameter if you want to use the user-specific search.
Enter a search you want to carry out in the extended query language in the Code parameter. Please note that the code needs to be within single inverted commas and single inverted commas within the query must be masked with another single inverted comma.
If the saved search or the code contain placeholders, then these need to be entered into the Placeholders parameter in the form Name=<comma-separated value>. The search result appears as a list of model elements; the UUID is outputted from this.
Examples
-
Enter the Model Version or Standalone Model for the Search
Get-InnoManagedModel -InoHost <license server>.16100 -Name 'abc*' | Find-InnoModelElements ...
Get-InnoStandaloneModel -InoHost <license server>.16100 -Name 'abc*' | Find-InnoModelElements ...
-
Search with Model-Wide Saved Search
... | Find-InnoModelElements -Name '<saved search>' -EnableModelWide
-
Search with Model-Wide Saved Search Using Placeholders
... | Find-InnoModelElements -Name '<saved search with placeholders>' -EnableModelWide -Placeholders '<value 1, value 2>'
-
Search with Extended Query Language
... | Find-InnoModelElements -Code 'SELECT FROM ELEMENTS WHERE "UUID" = ''113e5d54-8bfa-5166-8644-92cb879945ed'''
-
Search with Extended Query Language with Placeholders
... | Find-InnoModelElements -Code 'SELECT FROM ELEMENTS WHERE "UUID" = ''$UUID$''' -Placeholders 'UUID=113e5d54-8bfa-5166-8644-92cb879945ed'
