cancel
Showing results for 
Search instead for 
Did you mean: 

Support for PowerShell

Scott_Hardwick
Champ on-the-rise
Champ on-the-rise

Have any plans or roadmaps been announced to potentially support PowerShell in addition to (or as a replacement for) VBScript?

While I am fluent in PowerShell, I haven't used VBScript in probably 15 years.

Thanks for any information you may be able to provide.

2 ACCEPTED ANSWERS

AdamShaneHyland
Employee
Employee

Hi @Scott Hardwick ,

 

You can find more information required for creating a Client Pre-processor in the OnBase Automation and Client API documentation in the OnBase Client SDK ...

 

https://community.hyland.com/gallery/items/50539-onbase-client-sdk-all-versions

 

The documentation references using C#, but I imagine it wouldn't be hard to abstract that to PowerShell.  

 

@Jim Perry , but chance, do you have a high level example to share?

 

Best wishes.

View answer in original post

Eric_Maerz
Confirmed Champ
Confirmed Champ

Here is a quick example on how to get started with Unity API in Powershell. The Unity API Documentation can be found here https://sdk.onbase.com/

 

Import-Module -Name "C:\Program Files (x86)\Hyland\Hyland.Interop\Hyland.Types.dll"Import-Module -Name "C:\Program Files (x86)\Hyland\Hyland.Interop\Hyland.Unity.dll"$URL = "https://onbaseServer/AppServer64/service.asmx"$DataSource = "OnBaseDB_datasource"$Username = "user"$Password = "password"#Standard Login Proceodrue$oAppProps = [Hyland.Unity.Application]::CreateOnBaseAuthenticationProperties($URL, $Username, $Password, $DataSource);$oApp =  [Hyland.Unity.Application]::Connect($oAppProps)#NT Login Procedure#$oApp =  [Hyland.Unity.Application]::ConnectUsingDomainAuthentication($URL, $DataSource)#Get the logged in user's name$OnBaseUsername = $oApp.CurrentUser.RealNameWrite-Host "The current OnBase user is $name" #Get some document properties$Document = $oApp.Core.GetDocumentByID(1234)Write-Host "The document was created by: " + $Document.CreatedBy.DisplayName#Disconnect from OnBase$oApp.Disconnect()

View answer in original post

8 REPLIES 8

Adam_Kuhn
Star Collaborator
Star Collaborator

Hi Scott,

At present there are no plans to replace or augment VBScripts with PowerShell. If you would like an SCR for this functionality, however, feel free to reach out to the API Support team and request for an SCR.

Best,

Adam Kuhn, API Analyst

OCAPI | OCWE | OCWA | OCASA | OCI

Alex_French
Elite Collaborator
Elite Collaborator
What specific OnBase scripts are you interested in writing? I bet C# is really the answer you're looking for (even if you want the answer to be PowerShell).

In most capacities that I'm familiar with, C# would be the primary current tool. VBScript is being or recently has been deprecated from most uses, but there may still be little niches where it is the only option.

Unity Scripts can be written in C# or Visual Basic, but the huge majority of discussion in Hyland classes, at Tech Quest, and on Community has been in C# for as long as I've been here (~5 years).

Usage of the Unity API outside of Unity Scripts probably could be done in other .NET languages with a little work (but I've never heard of anyone doing it), or you could at least build PowerShell Cmdlets to use the Unity API. We've discussed that occasionally but never found a strong enough motivation to really look into it.

Scott_Poti1
Star Contributor
Star Contributor

I believe the answer is no based on the question above but figured I'd get the clarity. Can I run a Powershell script as a Preprocessor?

Yes. You can run PowerShell as a preprocessor. We prefer PowerShell as well. 

No one person needs to know everything—they simply need to know who knows it.