Your PowerGUI Community: Simplify your PowerShell related GUI and script editing needs.


Power GUI - Icons

This question is not answered
Guys,
This may be a strange request but is there any way of extracting the icons from the power packs?
All Replies
  • It's not a strange request. I'm curious though, why do you want to extract the icons? Knowing that may help identify a feature request for something we could support in PowerGUI.
  • What I did as a work-arround to get icons:
    - use Snaggit to capture the region containing the icon
    - zoom in to 400% in the editor
    - clip it to 16x16
    - save it to PNG
    - Open the PNG file in Paint.Net
    - Save it to a .ico file with32 bit version

    I did not get transparancy information using this approach.

    Snaggit can save to .ico as well, but importing it into PowerGui didn't work (does not show up)
    For Paint.Net you have to install the .ico support. See http://www.robertpeaslee.com/index.php/making-ico-icons-with-paintnet/

    Serge van den Oever [Macaw]
    http://weblogs.asp.net/soever
    http://www.twitter.com/svdoever
  • I'm developing a .net app to explorer ad/local groups and would like to keep the look and feel of the Users and Groups powerpack

    :)
  • I just figured out how to extract the Icons from PowerPacks, I am finalizing the script and once it is complete it will be available at [u]http://www.codeplex.com/pspowerpack[/u]. I should have it updated in the next day or two.

    I have a lot of plans for this module. Please let me know if you have any feature requests.
  • any update on this?
  • It is working, I am just working on creating some documentation. You can go ahead and download it and use the Export-Action function to export the Icons.

    -Russ
  • I must be having a dumb day. The icon is tored in the powerpack itslef within the XML right? I dont see any download link on that codeplex pkages you sent me. Is the link up or is there an alternative download location?
  • Yes, the icon is stored in the PowerPack Xml file.

    To download the current version:

    1. Goto [u]http://pspowerpack.codeplex.com[/u].
    2. Click on Source Code.
    3. On the right hand side under the "Lastest Version" section, click on the download link.
    4. Unzip to your modules folder.
    5. Import-Module PowerPack.

    * Note: You might have to unblock the files since they have been downloaded.

    The PowerPack will be extracted to a file / folder structure as follows:

    []
    ----.Actions.csv
    ----[Actions]
    --------[Icons]
    --------[Scripts]
    --------[Xml]

    Let me know what you think. You can file feature requests / bugs via the Codeplex Issue Tracker.
  • I would need powershell 2.0 for the modules functionality? Sorry for all the questions
  • Yes, it requires PowerShell 2.0. Is that an issue? I might be able to work around it if it is.
  • Nop, I am running XP Pro SP3 though so i'll get the windows management framework which has powershell bundled.

    Thanks!
  • Hi,
    I must eb doing something very basic. When i extact the source my directory shows:

    17/02/2010  09:59    <DIR>          .
    17/02/2010  09:59    <DIR>          ..
    17/02/2010  09:59             6,198 Export-Action.ps1
    17/02/2010  09:59             1,716 Export-Icon.ps1
    17/02/2010  09:59               936 Get-Action.ps1
    17/02/2010  09:59               556 Get-ActionFileNamePrefix.ps1
    17/02/2010  09:59               718 Get-ContainerItem.ps1
    17/02/2010  09:59             2,252 Import-Action.ps1
    17/02/2010  09:59             2,564 New-PSOCustomObject.ps1
    17/02/2010  09:59               328 PowerPack.psm1
    17/02/2010  09:59             2,184 Remove-Action.ps1
    17/02/2010  09:59             2,488 Set-PSODefaultProperties.ps1
                  10 File(s)         19,940 bytes
                   2 Dir(s)  22,897,434,624 bytes free

    I then run the command 'Import-Module PowerPack' from  powergui powershell command prompt. I the run 'Export-action'. What do i do then?
  • I got it running! sorry for that! thanks so much! this toll is excellent!
  • Here is a little piece of code from the PowerGUI team (thanks Oleg!) for extracting icons from .powerpack files.

    all you need to do is edit the paths to point to files/folders on your system.

    **Warning - big PowerPacks take a while - so test it on a small one first. ***

    $PowerPack = 'c:\StarTeam.powerpack'
    $FilePrefix = 'c:\ico\PP'
    Select-Xml -P $PowerPack '//IconB64' | %{,[Convert]::FromBase64String($_.Node.'#text')} | sort -u | %{sc "$FilePrefix$(([int]$i++)).ico" $_ -en Byte}


  • It would be nice if the PowerGUI team could release an icon pack for download.

    Here's how I extracted the base64 code from the .powerpack files and decoded it into a .ico file:
    Browse to \Program Files\PowerGUI\PowerPacks
    Open the .powerpack file with notepad
    Search for
    Every match will have the description above it in the container tag (ex:
    Copy all of the code inside the tags
    Go to http://www.motobit.com/util/base64-decoder-encoder.asp
    Paste the code into the box
    choose "decode the data from a Base64 string (base64 decoding) "
    choose "export to a binary file, filename:" and name the file, ending with .ico (ex: LockedUsers.ICO )
    Click "convert the source data" and you will be prompted to download the .ICO file.