Get-World | ConvertTo-PowerShell
Posts tagged Help
Auto complete for about_* topics
Jan 7th
Today I was heavily working with PowerShell help system. And was tired to call it using Get-Help cmdlet. So I created small function which I put to my profile:
function Show-HelpAboutFunction { $topics = Get-Help about_* foreach ($t in $topics) { $tn = $t.Name -replace 'about_', 'abt-' $text = "function global:$($tn) { Get-Help $($t.Name) }" Invoke-Expression "$text" } }
So when in console I can write: abt-func<Tab> and can circulate help topics till have the one I need. I know that for some topics is better to write Get-Help with partial help topic name, but in some cases I like my solution more.
Note: I know that abt is not approved verb
PowerShell help on Kindle
Jan 5th
I bought my Kindle few months ago. As I am reading whole day during every possible break I have the Kindle still with me. Last week I was checking new book from Don Jones – Learn Windows PowerShell in a Month of Lunches. As I ordered it in MEAP I like Kindle feature to add my own notes “directly” to the book. What I am missing – is PowerShell
So I decided to move help files to Kindle to be able check anything I need.
Amazon provides command line tool named KindleGen and I recommend you to download it together with Kindle Previewer (both located at Amazon Kindle’s Publishing Program page). With KindleGen you’ll receive also two samples so you can find how it works.
As a source I used CHM file provided with PowerShell (you can access it from ISE by pressing F1 key).
I simply extracted HTML files from that file (by running hh.exe –decompile hlp c:\windows\help\WindowsPowerShellHelp.chm) and then process those files with KindleGen. As a result I received nice MOBI file
You can download the result from this location.
As this was really funny work and whole process of the file creation is not described anywhere (AFAIK) I plan some blog posts in the near future to show how to work with KindleGen itself and also to show how I used PowerShell to help me with some conversion/copy&pasting/generating XHTML.
Please note that my influence to this book was only the conversion from CHM to MOBI. All the texts inside were created by people from PowerShell team (except to Preface – I added it just for clarification) and all kudos needs to be send to Redmond.
