Unsing SDK in Powershell Script
Posted: 09 Nov 2021, 08:22
Hallo!
Is it possible to use .NET based OPC UA SDK in Powershell with LicenseManager.
If I call AddProcessLicenses I always get this error:
'The invoked member is not supported in a dynamic assembly'
Is it possible to use .NET based OPC UA SDK in Powershell with LicenseManager.
If I call AddProcessLicenses I always get this error:
'The invoked member is not supported in a dynamic assembly'
Code: Select all
using namespace System.Collections.Generic
using namespace UnifiedAutomation.UaBase
$gApplicationLicenseManager = [UnifiedAutomation.UaBase.ApplicationLicenseManager]
$Path = $OpcUaPath + "\UnifiedAutomation\license.lic"
$Assembly = [System.Reflection.Assembly]
$ExecAssembly = $Assembly::GetExecutingAssembly()
$gApplicationLicenseManager::AddProcessLicenses($ExecAssembly, $Path)