Workspace-Guru

Check-IWC-DB-Cache.ps1

Dec 29th, 2018
1,249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $key = 'HKLM:\SOFTWARE\WOW6432Node\RES\Workspace Manager'
  2. $dbcachepath = (Get-ItemProperty -Path $key -Name LocalCachePath).LocalCachePath
  3. $size = "{0:N2} MB" -f ((Get-ChildItem $dbcachepath -Recurse | Measure-Object -Property Length -Sum -ErrorAction Stop).Sum / 1MB)
  4. $transactions = Get-ChildItem "$dbcachepath\Transactions"
  5.  
  6. Write-Host -ForegroundColor Yellow "The Ivanti Workspace Control DB cache folder located at $dbcachepath is $size"
  7.  
  8. If($transactions -eq $null){
  9. Write-host -ForegroundColor Green "The transactions folder is empty"
  10. } ELSE {
  11. Write-host -ForegroundColor Red "The transactions folder is not empty and contains the following files $transactions.name"
  12. }
Advertisement
Add Comment
Please, Sign In to add comment