脚本的逻辑更多

时间:2016-11-11 20:24:56

标签: powershell citrix

我有这个,我今天一直在努力,但我认为有更好的方法。谢谢您的帮助。目标是为用户清理Citrix。有时他们会得到一个糟糕的.ica文件。

Stop-Process -processname Receiver
sleep 60
Remove-Item $env:LOCALAPPDATA\temp\*.ica
Remove-Item $env:LOCALAPPDATA\temp\2\CTXReceiverLogs -Recurse
Remove-Item $env:LOCALAPPDATA\temp\2 -Recurse
Remove-Item $env:LOCALAPPDATA\temp\3\CTXReceiverLogs -Recurse
Remove-Item $env:LOCALAPPDATA\temp\3 -Recurse
Remove-Item $env:LOCALAPPDATA\temp\4\CTXReceiverLogs -Recurse
Remove-Item $env:LOCALAPPDATA\temp\4 -Recurse
Remove-Item $env:LOCALAPPDATA\temp\CTXReceiverLogs\1\*.etl
Remove-Item $env:LOCALAPPDATA\temp\CTXReceiverLogs\1\ -Recurse
Remove-Item $env:LOCALAPPDATA\temp\CTXReceiverLogs\ -Recurse
Remove-Item $env:LOCALAPPDATA\temp\CitrixLogs -Recurse
Remove-Item $env:LOCALAPPDATA\temp\*.tmp -Recurse

1 个答案:

答案 0 :(得分:0)

也许

first_row = worksheet[1]
# worksheet[row_index_from_1]

当然,您必须根据需要调整get-childitem -recurse -include CTXReceiverLogs*, *.ica, *.etl, *.tmp | remove-item -recurse -force 参数。