Last active
July 7, 2016 03:58
-
-
Save PrateekKumarSingh/b528e2b3e7d728d5fdda38105690d074 to your computer and use it in GitHub Desktop.
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
Function Get-DecompiledHTMLHelp | |
{ | |
[cmdletbinding()] | |
param( | |
[String] $Destination, [String]$Filename | |
) | |
$EXE = 'C:\Windows\hh.exe' | |
If(-not (Test-Path $destination)) | |
{ | |
"Destination folder doesn't exist" | |
} | |
elseIf(-not (Test-Path $Filename)) | |
{ | |
"Target .chm file not found, please make sure you're entering the full path and file name" | |
} | |
else | |
{ | |
Start-Process -FilePath $EXE -ArgumentList "-decompile $Destination $Filename" | |
$FilesAndFolder = Get-ChildItem $Destination -Recurse| group psiscontainer | |
$FolderCount = ($Filesandfolder| ?{$_.name -eq $true}).count | |
$FileCount = ($Filesandfolder| ?{$_.name -eq $False}).count | |
Write-host "Decompiled into $(if($Foldercount -gt 0){$Foldercount}else{0}) Folders and $(if($FileCount){$FileCount}else{0}) Files to Destination $Destination" -ForegroundColor Yellow | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment