madhupn
Flexera beginner

Issues with AdminStudio PowerShell Cmdlets

I am trying to automate certain processes of application management using PowerShell cmdlets. I have created a tool with a user interface that allows user to enter a list of application names and the script will search the catalog for the application and if its found in a specific group for testing application, then delete it from there, move the application files to a different repository and import it back under a different group. This is to be done as part of moving applications from testing to production environement.

The challenge i am facing is, the script just locks up after executing commands like Remove-ASApplication and Invoke-ASImportPackage. I don't seem to have an issue with Get-ASCatalogItem or Get-ASPackage commands, which runs and returns a value successfully.

The Remove and Invoke commands does perform desired action in AdminStudio, but doesn't seem to return a value and the script endlessly waits without procceding to the next action after the command is executed.

Once this happens, i will have to crash that PS session to exit the script. Attached is screenshot of the console window when the script is frozen!

Has anyone else come across such an issue? Any pointer to make this working will be of great help!

 

 

0 Kudos
7 Replies
chiranjeevi
Flexera
Flexera

@madhupn 

I tried to run Invoke-ASImportPackage, Remove-ASApplication cmdlets on a test catalog.

If a package gets imported successfully "Invoke-ASImportPackage" cmdlet returns the package object as shown in the attached screenshot "Invoke-ASImportPackage.JPG" which can be used to validate the import.

If an application is removed using the "Remove-ASApplication" cmdlet, it returns "The delete operation completed successfully." string as shown in the screenshot "Remove-ASApplication.JPG" which can be used to validate the success or failure.

Hope this helps.

0 Kudos

@chiranjeevi 

Thanks for checking. Unfortunately, the issue i am having is only when the cmdlet is executed from a script that loads a Windows form to accept user input and displays output to user your on the same screen. Script accepts an application name or ID a textbox control in the form, then deletes the application from catalog o a button click. When i call the Remove-ASApplication cmdlet, it executes, but doesn't return any value to the calling script and causes the calling script to just hang at that point.

Also, i am using AdminStudio 2015 SP1 module. Attached is a simple script i can use to reproduce the issue along with some screenshots. Just update the correct DB connection string value to: $asDBString

0 Kudos

@madhupn 

Thank you for your reply.

We'll take a look at the attached script and get back with the observations.

0 Kudos

Hi, have you been able to find anything?

I was able to get my script to working by creating an intermediate script that will only run the import cmdlet under another process. However, now i face random failures of the import cmdlet. It even happens from the PS console. Command gets completed without errors but an app object may not be returned as well as the app doesn't get imported in the backend. 

Can we get some help to investigate these failures? Is there any log at the server side that may help us find the root cause of this failure of the import cmdlet?

0 Kudos
madhupn
Flexera beginner

also, this seems to be happening more often after ASES 2018 upgrade. 

0 Kudos

Hi @madhupn ,

Can you confirm whether you have upgraded just ASES or AdminStudio also?

Are you seeing this issue only with specific packages or all the packages you try to import? Can you attach the screenshot of PowerShell output window once after you execute the commands.

Once you start the execution of AdminStudio cmdlet and after the AdminStudioHost starts by itself (it will start once you execute the Invoke-ASImportPackage command), you should see the logs in "C:\Program Files (x86)\AdminStudio\2020\Common\AdminStudioHost.log" file.


Regards,
Jaganath S

0 Kudos

Hi Jaganath,

I'll try to answer your questions the best way I can.

  1. We upgraded both
  2. All packages  
  3. Files attached

Please let us know if you need anything else.

Thanks,
Ed

 

0 Kudos