Invoke PowerShell by UiPath
UiPath能够调用PowerShell ,最近在项目中得到了实践:
需求:
某系统生成的日志文件的名字,时间戳只到分,形如bz20180214_1655.log
这样在如果在1分钟内生成多个日志,就会发生覆盖,只剩下最后的那个
处理:
将日志文件的名字补上秒位
代码:
gci "C:\uipath\sh\data\*_????.log" | %{
move-item $_.FullName ($_.DirectoryName+"\"+($_.Name -Replace "\.log$", "") + $(Get-Date -Format "ss")+".log")
}
转成字符串:
"gci ""C:\uipath\sh\data\*_????.log"" | %{move-item $_.FullName ($_.DirectoryName+""\""+($_.Name -Replace ""\.log$"", """") + $(Get-Date -Format ""ss"")+"".log"")}"
作成机器人:

IsScript要选上,因为是脚本
有输出的话,要注意设置TypeArgument,可以自行试一试
项目应用的话,可将机器人参数化
在UiPath Studio中执行结果:

以上。
Invoke PowerShell by UiPath的更多相关文章
- [转]UiPath Invoke Code
本文转自:https://dotnetbasic.com/2019/08/uipath-invoke-code.html We will learn step by step tutorial for ...
- 开机自启动Powershell脚本
目录 目录 前言 修改注册表 写批处理 以管理员方式打开Posershell程序 修改PS-profile 最后 前言 这绝B是个非常受用的技能. 修改注册表 Open Registry Editor ...
- 初试WIX加SQL LocalDB
最近有个项目需要生成一个自动打包安装App和数据库的MSI文件,经同事推荐WIX,于是乎就试了一试.遇到了一些问题觉得有分享的价值,所以写篇博客记录一下 :) 使用感觉: WIX特点:功能很强大,用X ...
- Best practice for Invoke other scripts or exe in PowerShell
Recently, I find I used many different type method to invoke other scripts or exe in PowerShell. May ...
- PowerShell - Invoke VBA function
$xl = new-object -comobject Excel.Application $source_wb = $xl.workbooks.open($source) $xl.visible=$ ...
- .net 使用PowerShell获取电脑中的UUID
UUID含义是通用唯一识别码 (Universally Unique Identifier),这 是一个软件建构的标准,也是被开源软件基金会 (Open Software Foundation, OS ...
- Call C# in powershell
How to call C# code in powershell Powershell Command Add-Type usage of Add-Type we use Add-Type -Typ ...
- C#调用PowerShell的经历
好久没有写程序了, 再次上手也处于功能强大的Windows PowerShell的缘故. 不多话, 先上段代码引入正题.... static Collection<PSObject> Ru ...
- 作为平台的Windows PowerShell(二)
在此系列文章的前一篇,我们看到了怎样使用System.Management.Automation.PowerShell 类来在c#应用程序中运行PowerShell 命令.在那些例子中,我们创建的都是 ...
随机推荐
- Python命令模块argparse学习笔记(三)
参数组 ArgumentParser.add_argument_group(title=None, description=None) 默认情况下,当显示帮助消息时,ArgumentParser将命令 ...
- SQL中top使用方法
转自:https://www.cnblogs.com/wang7/archive/2012/07/09/2582891.html 1. 在编写程序中,我们可能遇到诸如查询最热门的5篇文章或返回满足条件 ...
- python 基础 字典 小例子
统计单词次数 作为字典存储 cotent = "who have an apple apple is free free is money you know" result = { ...
- makefile基本语法
多文件编程的小例子功能:在main.c里面调用其他两个源文件里面的函数,然后输出字符串. 1.main.c #include"mytool1.h"#include" ...
- Http协议以及模拟http请求发送数据
1 为什么要使用http协议 假设我现在有两个客户端浏览器,一个是google,一个是IE浏览器:我现在有两个服务器,一个是tomcat,一个是JBoss;在最初的情况下是:如果google要往tom ...
- Entity Framework Code-First(9.9):DataAnnotations - ForeignKey Attribute
DataAnnotations - ForeignKey Attribute: ForeignKey attribute can be applied to properties of a class ...
- 7.30实习培训日志-SQL优化
总结 今天早上考试,下午主要是老师引导我们学习SQL优化,晚上主要是同学的技术分享,杨松柏同学主要给我们分享了java的io的一些东西,c10k问题,bio(同步阻塞IO),NIO(同步非阻塞IO), ...
- jquery事件之事件委托和事件切换
一.事件委托函数: 方法名 说明 语法 (events 事件类型,data数据,handler 事件处理函数,selector 选择器) live 用于为指定元素的一个或多个事件绑定事件处理函数. j ...
- Python中读取,显示,保存图片的方法
一 opencv import cv2 as cv # load img = cv.imread(imagepath) # shape=(height, width, channel) h,w,c = ...
- Collectd+InfluxDB+Grafana监控系统搭建
环境配置 节点 配置 类型 操作系统 Sched 2G 2CPU 50GB ens3=>192.168.200.11 KVM虚拟机 CentOS 7 Nova 4G 2CPU 50GB ens3 ...