A new Flexera Community experience is coming on November 18th, click here for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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!

 

 

(7) Replies

@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.

@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

@madhupn 

Thank you for your reply.

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

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?

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

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

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