Invoke PowerShell by Uipath

Source: Internet
Author: User

Uipath is able to invoke PowerShell and has recently been practiced in the project:

Demand:

The name of the log file generated by a system, time stamp only to minute, shape like Bz20180214_1655.log

This will overwrite if multiple logs are generated within 1 minutes, leaving only the last one.

Processing:

Fill the name of the log file with the second bit

Code:

    

1Gci"c:\uipath\sh\data\*_????. Log"| %{2Move-item$_. FullName ($_. directoryname+"\"+($_. Name-replace "\.log$","") + $ (get-date-format"SS")+". Log")3}
View Code

Turn into a string:

"GCI" "C:\uipath\sh\data\*_????. Log "" | %{move-item $_. FullName ($_. Directoryname+ "\" "+ ($_. Name-replace "" \.log$ "", "" "" ") + $ (get-date-format" "ss" ") +" ". Log" ")}"

Made into a robot:

    

ISScript to choose, because it's a script.

If you have output, you should pay attention to set typeargument, you can try it yourself

If the project is applied, the robot can be parameterized

To perform the results in Uipath Studio:

    

Above.

Invoke PowerShell by Uipath

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.