Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $DebugPreference = "Continue" #Continue|SilentlyContinue
- $64BitOS = "C:\Program Files (x86)\DELL\KACE\Inventory.log"
- $32BitOS = "C:\Program Files\DELL\KACE\Inventory.log"
- $CompareDate = (Get-Date).AddDays(-20)
- If (Test-Path $64BitOS)
- {Write-Debug 'File Found.'
- $FileObject64BitOS = Get-ItemProperty $64BitOS
- If ($FileObject64BitOS.LastWriteTime -gt $CompareDate)
- {Write-Debug 'KACE up to date.'}
- Else{Write-Debug 'KACE not up to date, file is older than compare date.'
- Out-File \\vlsrv02\nokace\"$env:computername No or OLD KACE Version.txt"}}
- If (Test-Path $32BitOS)
- {Write-Debug 'File Found.'
- $FileObject32BitOS = Get-ItemProperty $32BitOS
- If ($FileObject32BitOS.LastWriteTime -lt $CompareDate)
- {Write-Debug 'KACE up to date.'}
- Else{Write-Debug 'KACE not up to date, file is older than compare date.'
- Out-File \\vlsrv02\nokace\"$env:computername No or OLD KACE Version.txt"}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement