, , , remove-item:
Get-ChildItem "c:\users\$username\appdata\local\temp\*.ica" -Force -Recurse | Remove-Item -Confirm:True
- -
Get-ChildItem -Path "C:\Users\$username\appdata\local\temp" -Include '.ica' -Force -Recurse | Remove-Item -Confirm:True
, -Force Get-ChildItem, . , .
Edit:
foreach ($user in (Get-ChildItem -Directory C:\Users).name) { <
In addition, $ENV:TempPowerShell is equivalent %TEMP%. There are many other environment variables contained in $ENV:.
Or if you need to do this for all users:
Get-ChildItem -Path "C:\Users\" -Include '.ica' -Force -Recurse | Remove-Item -Confirm:True
source
share