MarketplaceStudioToolWorkflow Analyzer CLI Script

Create your first automation in just a few minutes.Try Studio Web

Workflow Analyzer CLI Script

Workflow Analyzer CLI Script

by Internal Labs

1

Tool

Downloads

226

Karine Comte
Posted 3 years ago

Hello Michael,

Thanks for your last answer but I don't need to repair the dependencie each time I open Studio, only the first time but it's not possible to open Studio onto the machines which are performing the analyze from Azure DevOps. Therefore the problem will appear each time a new custom library will be used. So I have to find a NOT manual solution.

Michael A. Agarenzo
Posted 3 years ago ago

Hello Karine,

Understood. In that case, the same may apply but on the Robot machine. Check %localappdata%\Programs\UiPath\Studio\Packages on the Robot machine and see if the custom library is there. If its not, then the Robot may not be able to pull the custom library from Orchestrator.

The next time the error occurs when you try analyzing from Azure DevOps, connect to the Robot machine and check the logs in %localappdata%\UiPath\Logs to find more details about the error.

Best,

Michael Agarenzo

Technical Account Manager at UiPath

Karine Comte
Posted 3 years ago

Hello,

I succeed to execute my powershell script based on your script from Azure DevOps but sometimes I encountered the following error :
Could not load file D:\abc\toto.xaml. Reason: Cannot create unknown type ‘{clr-namespace:LibAbc;assembly=LibAbc}LibAbc_xyz’. It's a custom library shared in the Orchestator.
If I open the project onto my Studio and I only run workflow analyzer, I have the same error. I have to click on repair dependencie onto the one which is in red. And after that, I can run the workflow analyzer. So, I think I need to execute repair dependencie in a command line without Studio but it is possible ? Or do you have any idea ? Thanks for your help.

Michael A. Agarenzo
Posted 3 years ago ago

Hello Karine,

Unfortunately I do not see a way to repair dependencies from command line, but there should be a reson behind why that custom library from Orchestrator needs to be repaired each time you open your project in Studio. Is there a job in place that is removing the package from the Studio machine?

Next time you open Studio and you are required to repair the dependency, take a look at %localappdata%\Programs\UiPath\Studio\Packages and see if the custom library is there. If its not, this can be the start of discovering what is removing it from your machine.

Best,

Michael Agarenzo

Technical Account Manager at UiPath

Rohan Tiwarri
Posted 4 years ago

Hi Michael,

I am new to powershell and tried the commands you mentioned but i am not able to make it work.

Would appreciate your help

PowerShell:-

PS C:\agent\Configuration> .\Workflow-Analyzer-CLI-Script.ps1 `

>> -ProjectFilePath "C:\agent\Configuration\Azure_Test\project.json" `

>> -ExecutableFilePath "C:\'Program Files (x86)'\UiPath\Studio\UiPath.Studio.CommandLine.exe" `

>> -OutputFilePath .\Workflow-Analysis.json

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:15 char:81

+ ... ãC*¥ÕºJH 0ô¨¨•º¶pvrú[vz’=z”J8j€Þßm´¹ÂÐuÝ:„Æè²-\„r8ä­Å’;,„£šhŒ6 ...

+                                                                  ~

Missing closing ')' in expression.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:15 char:93

+ ... ¹ÂÐuÝ:„Æè²-\„r8ä­Å’;,„£šhŒ6Ö'ï„©eý`¡“®’5Å@´NÏ„#$Œì0ÂuvpQ0 ‚#†Þ_¾ ...

+                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Unexpected token '©eý`¡“®’5Å@´NÏ„#$Œì0ÂuvpQ0' in expression or statement.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:16 char:19

+ ~Üá÷m8[‡¢äç¹,‘SB,Z'îrzCð9‡¥~yÜX9QGÒ×q”í½ÊxîGGßSÞÑ ...

+                   ~

Missing argument in parameter list.

At C:\agent\a¥ZP¯ I§ä[½–œ"^ ÇqöPTX|[lyzer-CLI-Script.ps1:17 char:42

+                                          ~

Missing type name after '['.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:23 char:7

+ ‘¿X4‘Fe}jZ+¾6ÝCN±LÍ3˜@ø«”òA:ŸËʇËó$Éó¼a(–¡$cê=l e¸ÕdD HÇÙÐF” ...

+       ~~

Unexpected token 'Fe' in expression or statement.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:23 char:9

+ ‘¿X4‘Fe}jZ+¾6ÝCN±LÍ3˜@ø«”òA:ŸËʇËó$Éó¼a(–¡$cê=l e¸ÕdD HÇÙÐF” ...

+         ~

Unexpected token '}' in expression or statement.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:23 char:219

+ ... ýšô…°ÚÄ)Á÷¢™ Ÿý½äÙäiuä;ŒoŸÜmò`Û”aðb˃ðá®iÂÿãp!ýæžÂà¹Î^ ÿPK

+                                                                          ~

Missing closing ')' in expression.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:24 char:22

+      jWjQ            )      Workflow-Analyzer-CLI-Script-1.4.1/media/ ...

+                      ~

Unexpected token ')' in expression or statement.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:28 char:114

+ ... "EšZeY–UÙîu:°M¸Ø=w¯:ð:8ëÊqf#*pöº    @ðu‘©Ô®ž¯píùhµÆ]Ž#}b»Ás̾íù ...

+                                                                 ~

Unexpected token '}' in expression or statement.

At C:\agent\Configuration\Workflow-Analyzer-CLI-Script.ps1:28 char:147

+ ... öº    @ðu‘©Ô®ž¯píùhµÆ]Ž#}b»Ás̾íùa‹—BõâÁq»÷AàÑÌ×Ï? 0(8$4,

Michael A. Agarenzo
Posted 4 years ago ago

Hi Rohan,

Some of your pasted errors are unrecognizable characters. Regardless, here are some of my first thoughts that you should double check in your environment:

  • Are you in the same directory as the script?
  • Is your project file path correct?
  • Is your executable file path correct?
  • Do you have Administrator privileges in PowerShell?

Best,

Michael Agarenzo

Senior Technical Advisor at UiPath

David Pajon Lenis
Posted 4 years ago

Hi, let me know how to integrate this with Jenkins Pipeline please.

Michael A. Agarenzo
Posted 4 years ago ago

Hi David,

There are a few ways you can integrate PowerShell scripts with Jenkins Pipeline. Please check out the following resources:

  • Microsoft PowerShell Support for Pipeline - https://www.jenkins.io/blog/2017/07/26/powershell-pipeline/
  • Pipeline: Nodes and Processes - https://www.jenkins.io/doc/pipeline/steps/workflow-durable-task-step/
  • Getting Started Running PowerShell Scripts in Jenkins - https://adamtheautomator.com/jenkins-powershell/

Best,

Michael Agarenzo

Senior Technical Advisor at UiPath

Nithyaselvan Jeyaram
Posted 4 years ago

Hi Michael - I have the same question as David Kim below. How do we references the rulesconfig.json in the pipeline?

Michael A. Agarenzo
Posted 4 years ago ago

Hi Nithyaselvan,

  1. Which rules file are you talking about? Is it UiPath.Studio.RulesLibrary[...].json in the .\UiPath\Studio\Rules directory?
  2. Can you please share the error you are receiving when running this from your pipeline?

Best,

Michael Agarenzo

Senior Technical Advisor at UiPath

David Kim
Posted 4 years ago

When using commandline.exe into a devops pipeline how is the ruleconfig.json integrated into this process below. Normally in a on premise machine rulesconfig .json is located within the user profile,... how do we handle this in devops?  Rule.config.json is needed to provide analyzyer with rules to evaluate project.json.  Please give specifics.  Thank You.

The below is the UiPath provided Azure CLI script that has been modified for my devops pipeline.  (Workflow Anaylzer)

param (

    $ProjectFilePath= $(Buildin.SourcesDirectory)\TESTREPO7\project.json

    $ExecutableFilePath= $(Buildin.SourcesDirectory)\TESTREPO7\Studio.zip\Studio\UiPath.Studio.CommandLine.exe

    $OutputFilePath= $(Buildin.SourcesDirectory)\$(Get-Date -Format 'yyyy-MM-dd-HH-mm-ss')-Workflow-Analysis.json

    )

Write-Output "$(Get-Date -Format 'HH:mm:ss') - STARTED - Workflow Analyzer CLI Script"

$Command = "$ExecutableFilePath analyze -p $ProjectFilePath"

Invoke-Expression $Command | Out-File -FilePath $OutputFilePath

Write-Output "$(Get-Date -Format 'HH:mm:ss') - COMPLETED - Workflow Analyzer CLI Script"

Michael A. Agarenzo
Posted 4 years ago ago

Hi David,

I have replied to you via email.

Best,

Michael Agarenzo

Senior Technical Advisor at UiPath

Muthukumar Murugesan
Posted 4 years ago

Hi, let me know how to integrate this with Azure Pipeline please.

Michael A. Agarenzo
Posted 4 years ago ago

Hi Muthukumar,

There are a number of ways you could integrate this script with Azure Pipelines. For example, you could add a task to a pipeline with conditions that depend on the results of this script to either continue or cancel a deployment.

Here are a couple of Microsoft docs to help you get started:

  • Specify conditions - https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions
  • Use a PowerShell script to customize your build pipeline - https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/powershell

Best,

Michael Agarenzo

Senior Technical Advisor at UiPath

Publisher

Internal Labs

Visit publisher's page

License & Privacy

MIT

Privacy Terms

Technical

Version

1.4.1

Updated

November 16, 2020

Works with

Studio: 19.10 - 22.10

Certification

Silver Certified

Application

UiPath Studio

Support

UiPath Community Support