Get-PC/Private/ClearCCMCache.ps1

12 lines
417 B
PowerShell
Raw Normal View History

2024-07-26 18:44:25 +00:00
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
}
}