{"id":1078,"date":"2011-01-25T11:25:43","date_gmt":"2011-01-25T16:25:43","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1078"},"modified":"2011-01-25T11:25:43","modified_gmt":"2011-01-25T16:25:43","slug":"importing-and-exporting-registry-items","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/","title":{"rendered":"Importing and Exporting Registry Items"},"content":{"rendered":"<p>A while ago I posted a function to <a href=\"http:\/\/jdhitsolutions.com\/blog\/2010\/10\/export-registry\/\" target=\"_blank\">export registry items<\/a> to either a CSV or XML file. Recently I had a question on <a href=\"http:\/\/twitter.com\/jeffhicks\" target=\"_blank\">Twitter <\/a>about importing, which I assumed meant from my exported file. The import is actually pretty easy as I'll show you, although it did require a change to the original Export-Registry function.<!--more--><\/p>\n<p>The main challenge when creating registry entries is to get the type correct. In my original version I took a convulated and kludgy approach. But thanks to my fellow PowerShell MVPs I learned a better way to get the underlying registry type such as String, ExpandedString or DWord. First, it is much easier to get the registry keys without all the extra PSPath stuff.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nForeach ($item in $path) {<br \/>\n        Write-Verbose \"Getting $item\"<br \/>\n        $regItem=Get-Item -Path $item<br \/>\n        #get property names<br \/>\n        $properties= $RegItem.Property<br \/>\n[\/cc]<br \/>\nI can now easily get each property value using the GetValue() method and the underlying type using GetValueKind().<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nforeach ($property in $properties) {<br \/>\n                Write-Verbose \"Exporting $property\"<br \/>\n                $value=$regItem.GetValue($property,$null,\"DoNotExpandEnvironmentNames\")<br \/>\n                #get the registry value type<br \/>\n                $regType=$regItem.GetValueKind($property)<br \/>\n                $PropertyItem=$property<br \/>\n[\/cc]<br \/>\nWhen calling GetValue(), I'm tell PowerShell not to expand environment strings, which is otherwise the default. This allows me to export %COMPUTERNAME% as the value as apposed to the expanded value. This is critical when it comes time to import.  Here's my revised function with the comment based help omitted.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nFunction Export-Registry {<\/p>\n<p>[cmdletBinding()]<\/p>\n<p>Param(<br \/>\n[Parameter(Position=0,Mandatory=$True,<br \/>\nHelpMessage=\"Enter a registry path using the PSDrive format.\",<br \/>\nValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]<br \/>\n[ValidateScript({(Test-Path $_) -AND ((Get-Item $_).PSProvider.Name -match \"Registry\")})]<br \/>\n[Alias(\"PSPath\")]<br \/>\n[string[]]$Path,<\/p>\n<p>[Parameter()]<br \/>\n[ValidateSet(\"csv\",\"xml\")]<br \/>\n[string]$ExportType,<\/p>\n<p>[Parameter()]<br \/>\n[string]$ExportPath,<\/p>\n<p>[switch]$NoBinary<\/p>\n<p>)<\/p>\n<p>Begin {<br \/>\n    Write-Verbose -Message \"$(Get-Date) Starting $($myinvocation.mycommand)\"<br \/>\n    #initialize an array to hold the results<br \/>\n    $data=@()<br \/>\n } #close Begin<\/p>\n<p>Process {<br \/>\n    #go through each pipelined path<br \/>\n    Foreach ($item in $path) {<br \/>\n        Write-Verbose \"Getting $item\"<br \/>\n        $regItem=Get-Item -Path $item<br \/>\n        #get property names<br \/>\n        $properties= $RegItem.Property<br \/>\n        Write-Verbose \"Retrieved $(($properties | measure-object).count) properties\"<br \/>\n        if (-not ($properties))<br \/>\n            {<br \/>\n                #no item properties were found so create a default entry<br \/>\n                $value=$Null<br \/>\n                $PropertyItem=\"(Default)\"<br \/>\n                $RegType=\"String\"<\/p>\n<p>                #create a custom object for each entry and add it the temporary array<br \/>\n                $data+=New-Object -TypeName PSObject -Property @{<br \/>\n                    \"Path\"=$item<br \/>\n                    \"Name\"=$propertyItem<br \/>\n                    \"Value\"=$value<br \/>\n                    \"Type\"=$regType<br \/>\n                    \"Computername\"=$env:computername<br \/>\n                 }<br \/>\n            }       <\/p>\n<p>            else<br \/>\n            {<br \/>\n            #enumrate each property getting itsname,value and type<br \/>\n            foreach ($property in $properties) {<br \/>\n                Write-Verbose \"Exporting $property\"<br \/>\n                $value=$regItem.GetValue($property,$null,\"DoNotExpandEnvironmentNames\")<br \/>\n                #get the registry value type<br \/>\n                $regType=$regItem.GetValueKind($property)<br \/>\n                $PropertyItem=$property<\/p>\n<p>                #create a custom object for each entry and add it the temporary array<br \/>\n                $data+=New-Object -TypeName PSObject -Property @{<br \/>\n                    \"Path\"=$item<br \/>\n                    \"Name\"=$propertyItem<br \/>\n                    \"Value\"=$value<br \/>\n                    \"Type\"=$regType<br \/>\n                    \"Computername\"=$env:computername<br \/>\n                 }<br \/>\n               } #foreach<br \/>\n            } #else<br \/>\n    }#close Foreach<br \/>\n } #close process<\/p>\n<p>End {<br \/>\n  #make sure we got something back<br \/>\n  if ($data)<br \/>\n  {<br \/>\n    #filter out binary if specified<br \/>\n    if ($NoBinary)<br \/>\n    {<br \/>\n        Write-Verbose \"Removing binary values\"<br \/>\n        $data=$data | Where {$_.Type -ne \"Binary\"}<br \/>\n    }<\/p>\n<p>    #export to a file both a type and path were specified<br \/>\n    if ($ExportType -AND $ExportPath)<br \/>\n    {<br \/>\n      Write-Verbose \"Exporting $ExportType data to $ExportPath\"<br \/>\n      Switch ($exportType) {<br \/>\n        \"csv\" { $data | Export-CSV -Path $ExportPath -noTypeInformation }<br \/>\n        \"xml\" { $data | Export-CLIXML -Path $ExportPath }<br \/>\n      } #switch<br \/>\n    } #if $exportType<br \/>\n    elseif ( ($ExportType -AND (-not $ExportPath)) -OR ($ExportPath -AND (-not $ExportType)) )<br \/>\n    {<br \/>\n        Write-Warning \"You forgot to specify both an export type and file.\"<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        #write data to the pipeline<br \/>\n        $data<br \/>\n    }<br \/>\n   } #if $#data<br \/>\n   else<br \/>\n   {<br \/>\n        Write-Verbose \"No data found\"<br \/>\n        Write \"No data found\"<br \/>\n   }<br \/>\n     #exit the function<br \/>\n     Write-Verbose -Message \"$(Get-Date) Ending $($myinvocation.mycommand)\"<br \/>\n } #close End<\/p>\n<p>} #end Function<br \/>\n[\/cc]<br \/>\nNow I can export a registry key to an XML format. CSV is ok if everything is a simple string, otherwise I strongly suggest using XML.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> export-registry hkcu:\\jdhit -ExportType XML -ExportPath C:\\work\\jdhitreg.xml<br \/>\n[\/cc]<br \/>\nNow let's import. You could script this if you want but it is pretty straightforward. First, import the XML file and take a look at a few sample entries.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> $data=Import-Clixml c:\\work\\jdhitreg.xml<br \/>\nPS C:\\> $data[-1,-2,-3]<\/p>\n<p>Value        : %computername%<br \/>\nName         : computer<br \/>\nPath         : hkcu:\\jdhit<br \/>\nType         : ExpandString<br \/>\nComputername : SERENITY<\/p>\n<p>Value        : Jeff<br \/>\nName         : Name<br \/>\nPath         : hkcu:\\jdhit<br \/>\nType         : String<br \/>\nComputername : SERENITY<\/p>\n<p>Value        : {apple, banana, cherry}<br \/>\nName         : fruit<br \/>\nPath         : hkcu:\\jdhit<br \/>\nType         : MultiString<br \/>\nComputername : SERENITY<br \/>\n[\/cc]<br \/>\nWe have all the information we need to pipe these objects to New-ItemProperty, assuming the path already exists. I use -Force to overwrite any existing items.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n$data | Foreach {<br \/>\n    #$_<br \/>\n    #Write the new entries, overwriting any existing.<br \/>\n    New-ItemProperty -Path $_.Path -Name $_.Name -Value $_.Value -PropertyType $_.Type -Force<br \/>\n}<br \/>\n[\/cc]<br \/>\nIt should be that simple. You'll have to test things out and let me know.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/01\/Export-Registry-v2.txt' target='_Blank'>Export-Registry-v2.ps1<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while ago I posted a function to export registry items to either a CSV or XML file. Recently I had a question on Twitter about importing, which I assumed meant from my exported file. The import is actually pretty easy as I&#8217;ll show you, although it did require a change to the original Export-Registry&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,75,110],"tags":[204,224,247,112,246,248,534,560],"class_list":["post-1078","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-v2-0","category-registry","tag-export","tag-function","tag-get-item","tag-get-itemproperty","tag-import","tag-new-itemproperty","tag-powershell","tag-registry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Importing and Exporting Registry Items &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Importing and Exporting Registry Items &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"A while ago I posted a function to export registry items to either a CSV or XML file. Recently I had a question on Twitter about importing, which I assumed meant from my exported file. The import is actually pretty easy as I&#039;ll show you, although it did require a change to the original Export-Registry...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-01-25T16:25:43+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Importing and Exporting Registry Items\",\"datePublished\":\"2011-01-25T16:25:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/\"},\"wordCount\":763,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"export\",\"Function\",\"Get-Item\",\"Get-ItemProperty\",\"import\",\"New-ItemProperty\",\"PowerShell\",\"Registry\"],\"articleSection\":[\"PowerShell\",\"PowerShell v2.0\",\"Registry\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/\",\"name\":\"Importing and Exporting Registry Items &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-01-25T16:25:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1078\\\/importing-and-exporting-registry-items\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Importing and Exporting Registry Items\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Importing and Exporting Registry Items &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/","og_locale":"en_US","og_type":"article","og_title":"Importing and Exporting Registry Items &#8226; The Lonely Administrator","og_description":"A while ago I posted a function to export registry items to either a CSV or XML file. Recently I had a question on Twitter about importing, which I assumed meant from my exported file. The import is actually pretty easy as I'll show you, although it did require a change to the original Export-Registry...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-01-25T16:25:43+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Importing and Exporting Registry Items","datePublished":"2011-01-25T16:25:43+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/"},"wordCount":763,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["export","Function","Get-Item","Get-ItemProperty","import","New-ItemProperty","PowerShell","Registry"],"articleSection":["PowerShell","PowerShell v2.0","Registry"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/","name":"Importing and Exporting Registry Items &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-01-25T16:25:43+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Importing and Exporting Registry Items"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":984,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/984\/export-registry\/","url_meta":{"origin":1078,"position":0},"title":"Export Registry","author":"Jeffery Hicks","date":"October 18, 2010","format":false,"excerpt":"Over the last week or so I've posted some functions for testing whether a given registry item exists or not, or even validating its value. To round this out, today I have an advanced function that makes it easier to export parts of the registry on the local computer. The\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/export-registry-help-1024x526.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/export-registry-help-1024x526.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/export-registry-help-1024x526.png?resize=525%2C300 1.5x"},"classes":[]},{"id":953,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/","url_meta":{"origin":1078,"position":1},"title":"Test Registry Item","author":"Jeffery Hicks","date":"October 4, 2010","format":false,"excerpt":"I've been doing some work lately involving the registry and Windows PowerShell. One of the tasks was to create new registry keys and entries. But because I wanted to some robustness, I wanted a way to verify if a given key or entry already existed. Using Get-ItemProperty is the easy\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1811,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1811\/export-registry-printer-information-i-came\/","url_meta":{"origin":1078,"position":2},"title":"Export Registry Printer Information I came&#8230;","author":"Jeffery Hicks","date":"November 2, 2011","format":false,"excerpt":"Export Registry Printer InformationI came across this post http:\/\/www.oncallpros.com\/2011\/11\/02\/powershell-export-your-print-configuration-from-registry\/ on exporting printer information from the registry in PowerShell. I wanted to offer some constructive suggestions but could find no way to comment so I'll do so here.First, the article introduces some good PowerShell concepts. I like that he is using\u2026","rel":"","context":"In &quot;Google Plus&quot;","block_context":{"text":"Google Plus","link":"https:\/\/jdhitsolutions.com\/blog\/category\/google-plus\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":455,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/455\/get-printer\/","url_meta":{"origin":1078,"position":3},"title":"Get-Printer","author":"Jeffery Hicks","date":"October 16, 2009","format":false,"excerpt":"I think Out-Printer is a very handy cmdlet, and one that doesn\u2019t get used much. Pipe any cmdlet to it and the output will be printed to your default printer. You use it the same way you would Out-File except output is printed instead of saved to a file. The\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":53,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/53\/writing-the-registry-in-powershell\/","url_meta":{"origin":1078,"position":4},"title":"Writing the Registry in PowerShell","author":"Jeffery Hicks","date":"September 22, 2006","format":false,"excerpt":"Last month I showed you how to read the registry in PowerShell. I went through a script that would read the registered owner and organization. Now I'll show you how to change those properties in PowerShell. Here's the script, which is also available for download from my script library. Here's\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8612,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8612\/update-registry-os-productname-with-powershell\/","url_meta":{"origin":1078,"position":5},"title":"Update Registry OS ProductName with PowerShell","author":"Jeffery Hicks","date":"October 12, 2021","format":false,"excerpt":"I expect many of you are like me and have done, or will do, an in-place upgrade from Windows 10 to Windows 11. It is easy enough to run a PowerShell expression like this to see the operating system name. Get-CimInstance win32_operatingsystem | Select-Object -property Caption I get a value\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/set-psproduct2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/set-psproduct2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/set-psproduct2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/set-psproduct2.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1078"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1078\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}