我有几行在远程目录中查找的 powershell 代码
Get-ChildItem "\\box_lab001\f$\output files" -force |
Where-Object {!$_.PsIsContainer -AND $_.lastWriteTime -lt (Get-Date).AddMinutes(-5) } |
Select-Object LastWriteTime,@{n="Path";e={convert-path $_.PSPath}} |
Tee-Object "\\\box_lab001\c$\Users\john\Documents\output files_root.txt" |
Remove-Item -force
我想要做的是让这个在多个盒子中可扩展,如果用户在 box_lab01 上看到问题,槽 10。然后他可以使用一个要求输入的开关运行脚本。然后它会单独运行命令,每次都替换 box_lab###,可能吗?
C:\powershell.ps1 -input
what boxes are having the issue? use three digit numbers only, comma separated