Get-PC/Private/ClearCCMCache.ps1
2024-07-26 11:44:25 -07:00

12 lines
417 B
PowerShell

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
}
}