function Invoke-ClearCCMCache($ComputerName) { #Checks if the path is accessible to the requested PC if(Test-Path \\$ComputerName\C$){ Remove-Item \\$ComputerName\C$\Windows\ccmcache -Recurse Write-Host "Removed \\$ComputerName\C$\Windows\ccmcache" -ForeGround Green }else{ Write-Host "Could not connect to [\\$ComputerName\C$]" -ForeGround Red } }