Public/Get/Get-ImportedISETheme.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function Get-ImportedISETheme {
[CmdletBinding()]
param()
    #-Get theme values from registry
    $Themes = Get-Item registry::HKey_Current_User\Software\Microsoft\PowerShell\3\Hosts\PowerShellISE\ColorThemes | Select-Object -ExpandProperty Property

    #-Get name and xml content and return it as an object
    $Themes | ForEach-Object {
        $ThemeName = $_
        $Theme = Get-ItemProperty HKCU:\Software\Microsoft\PowerShell\3\Hosts\PowerShellISE\ColorThemes -Name $ThemeName
        $Theme | ForEach-Object {
            $xml = $_.$ThemeName
        }

        $hash = @{ThemeName = $_; XML = $xml}                                    
        $Object = New-Object PSObject -Property $hash
        $Object
        
    }
    <#
     .SYNOPSIS
      Returns imported themes
 
  .DESCRIPTION
   Returns imported themes from the registry
 
        .EXAMPLE
   PS C:\> $Themes = Get-ImportedISETheme
 
            Gets the imported ISE themes from the registry and assigns it to Themes
 
  .NOTES
            Part of the ISEColorThemeCmdlets.ps1 Script by Jeff Pollock
            http://Lifeinpowerhsell.blogspot.com
            http://gallery.technet.microsoft.com/ISE-Color-Theme-Cmdlets-24905f9e
 #>


}