-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from ddubose/AppCompatCache
Add Get-AppCompatCache Module
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<# | ||
.SYNOPSIS | ||
Get-AppCompatCache.ps1 | ||
When run via Kansa.ps1 with -Pushbin flag, this module will copy | ||
AppCompatCacheParser.exe to the remote system, then run | ||
AppCompatCacheParser.exe --csv $AppCompatCacheParserOutputPath on the remote system, | ||
and return the output data as a powershell object. | ||
AppCompatCacheParser.exe can be downloaded from http://ericzimmerman.github.io/ | ||
.NOTES | ||
Kansa.ps1 directives | ||
OUTPUT CSV | ||
BINDEP .\Modules\bin\AppCompatCacheParser.exe | ||
#> | ||
|
||
|
||
#Setup Variables | ||
$AppCompatCacheParserPath = ($env:SystemRoot + "\AppCompatCacheParser.exe") | ||
$Runtime = ([String] (Get-Date -Format yyyyMMddHHmmss)) | ||
$suppress = New-Item -Name "ACCP-$($Runtime)" -ItemType Directory -Path $env:Temp -Force | ||
$AppCompatCacheParserOutputPath = $($env:Temp + "\ACCP-$($Runtime)") | ||
|
||
if (Test-Path ($AppCompatCacheParserPath)) { | ||
#Run AppCompatCacheParser.exe | ||
$suppress = & $AppCompatCacheParserPath --csv $AppCompatCacheParserOutputPath | ||
|
||
#Output the data. | ||
Import-Csv -Delimiter "`t" "$AppCompatCacheParserOutputPath\*.tsv" | ||
|
||
#Delete the output folder. | ||
$suppress = Remove-Item $AppCompatCacheParserOutputPath -Force -Recurse | ||
|
||
} else { | ||
Write-Error "AppCompatCacheParser.exe not found on $env:COMPUTERNAME" | ||
} |