首页 > 代码库 > powershell.exe直接运行命令

powershell.exe直接运行命令

powershell.exe -Command "& { (‘time={0},user={1}‘ -f (get-date),(whoami)) | Out-File "d:\user.log" -Append }"

 

给.exe文件添加参数,参数是 array 格式

$argus = "$env:windir\", ‘c:\jpegs\‘,‘*.jpg‘, ‘/R:0‘, ‘/S‘, ‘/XD‘, ‘*winsxs*‘
Robocopy.exe $argus

powershell.exe直接运行命令