{"id":953,"date":"2010-10-04T09:00:11","date_gmt":"2010-10-04T13:00:11","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=953"},"modified":"2010-10-01T22:42:08","modified_gmt":"2010-10-02T02:42:08","slug":"test-registry-item","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/","title":{"rendered":"Test Registry Item"},"content":{"rendered":"<p>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.<!--more--><\/p>\n<p>Using Get-ItemProperty is the easy way to accomplish this.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> get-itemproperty -Path HKCU:\\jdhit\\powershell -name test<\/p>\n<p>PSPath       : Microsoft.PowerShell.Core\\Registry::HKEY_CURRENT_USER\\jdhit\\powershell<br \/>\nPSParentPath : Microsoft.PowerShell.Core\\Registry::HKEY_CURRENT_USER\\jdhit<br \/>\nPSChildName  : powershell<br \/>\nPSDrive      : HKCU<br \/>\nPSProvider   : Microsoft.PowerShell.Core\\Registry<br \/>\nTest         : Foo<br \/>\n[\/cc]<br \/>\nThis is just fine if it exists, but a pain if it doesn't.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> get-itemproperty -Path HKCU:\\jdhit\\powershell -name bogus<br \/>\nGet-ItemProperty : Property bogus does not exist at path HKEY_CURRENT_USER\\jdhit\\powershell.<br \/>\nAt line:1 char:17<br \/>\n+ get-itemproperty <<<<  -Path HKCU:\\jdhit\\powershell -name bogus\n    + CategoryInfo          : InvalidArgument: (bogus:String) [Get-ItemProperty], PSArgumentException\n    + FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.GetItemPr\n   opertyCommand\n[\/cc]\nSo I ended up writing a wrapper function that returns True or False if the item exist. The function handles the error handling and also takes transactions into account, since that might be a factor when working with the registry.\n[cc lang=\"PowerShell\"]\nFunction Test-RegistryItem {\n\n<#\n.SYNOPSIS\n\tTest the the existence of a registry value\n\n.DESCRIPTION\n\tThis command will determine if a given registry key exists. You must specify a registry path\n\tand the name of the key. \n\n.PARAMETER Path\n\tThe registry path using the registry PSDrive format, ie HLKLM:\n\n.PARAMETER Property\n\tThe property name to check. The parameter as an alias of Name.\n\t\n.PARAMETER UseTransaction\n\tUse an active transaction. This parameter is valid only when a transaction is in progress.\n \tFor more information, see about_Transactions.\n\n.EXAMPLE\n\tPS C:\\> test-itemproperty -Path \"HKLM:\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -Property \"Shell\"<br \/>\n\tTrue<\/p>\n<p>.INPUTS<br \/>\n\t[String]<\/p>\n<p>.OUTPUTS<br \/>\n\t[Boolean]<\/p>\n<p>.NOTES<br \/>\n  NAME: Test-RegistryItem<br \/>\n  AUTHOR: Jeffery Hicks<br \/>\n  VERSION: 1.0<br \/>\n  LASTEDIT: 10\/01\/2010<\/p>\n<p> Learn more with a copy of Windows PowerShell 2.0: TFM (SAPIEN Press 2010)<\/p>\n<p>.LINK<br \/>\n\tGet-ItemProperty<br \/>\n.LINK<br \/>\n\thttp:\/\/jdhitsolutions.com\/blog<\/p>\n<p>#><\/p>\n<p>[cmdletbinding()]<\/p>\n<p>Param (<br \/>\n\t[Parameter(Position=0,Mandatory=$True,HelpMessage=\"Enter a registry path using the PSDrive format.\")]<br \/>\n\t[ValidateNotNullOrEmpty()]<br \/>\n    [string]$Path,<\/p>\n<p>\t[Parameter(Position=1,Mandatory=$True,HelpMessage=\"Enter a registry key name.\")]<br \/>\n\t[ValidateNotNullOrEmpty()]<br \/>\n\t[Alias(\"name\")]<br \/>\n    [string]$Property,<br \/>\n    [Switch]$UseTransaction<br \/>\n)<br \/>\n \tWrite-Verbose (\"Looking for {0} in {1}\" -f $Property,$Path)<br \/>\n    if (Test-Path $path)<br \/>\n    {<br \/>\n    \tif ($UseTransaction)<br \/>\n    \t{<br \/>\n    \t\t$item=Get-ItemProperty -Path $path -Name $property -ErrorAction \"SilentlyContinue\" -UseTransaction<br \/>\n    \t} else<br \/>\n    \t{<br \/>\n    \t\t$item=Get-ItemProperty -Path $path -Name $property -ErrorAction \"SilentlyContinue\"<br \/>\n    \t}<\/p>\n<p>        if ($item )<br \/>\n        {<br \/>\n        \t#display the item if using -Verbose<br \/>\n        \tWrite-Verbose ($item | select * | Out-String)<br \/>\n            $True<br \/>\n        }<br \/>\n        else<br \/>\n        {<br \/>\n        \tWrite-Verbose \"Not found\"<br \/>\n            $False<br \/>\n        }<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        Write-Warning \"Failed to find $path\"<br \/>\n        $False<br \/>\n    }<\/p>\n<p>} #end function<br \/>\n[\/cc]<\/p>\n<p>The function uses the same parameters as Get-ItemProperty, although it adds an extra step to verify that the registry path exists by using Test-Path. Now, I can easily test for a key.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> test-registryitem -Path HKCU:\\jdhit\\powershell -name bogus<br \/>\nFalse<br \/>\nPS S:\\> test-registryitem -Path HKCU:\\jdhit\\powershell -name test<br \/>\nTrue<br \/>\n[\/cc]<\/p>\n<p>This makes my scripting much more efficient.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nif (-not (Test-registryitem -path HKCU:\\jdhit\\powershell -name blog))<br \/>\n{<br \/>\n  new-itemproperty -path HKCU:\\jdhit\\powershell -name blog -value http:\/\/jdhitsolutions.com\/blog<br \/>\n}<br \/>\n[\/cc]<br \/>\nDownload <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/Test-RegistryItem.txt'>Test-RegistryItem.ps1<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;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.<\/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,8],"tags":[224,112,534,560,238],"class_list":["post-953","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-function","tag-get-itemproperty","tag-powershell","tag-registry","tag-transaction"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Test Registry Item &#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\/953\/test-registry-item\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Test Registry Item &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;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.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2010-10-04T13:00:11+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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Test Registry Item\",\"datePublished\":\"2010-10-04T13:00:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/\"},\"wordCount\":188,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Function\",\"Get-ItemProperty\",\"PowerShell\",\"Registry\",\"transaction\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/\",\"name\":\"Test Registry Item &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2010-10-04T13:00:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/953\\\/test-registry-item\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Test Registry Item\"}]},{\"@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":"Test Registry Item &#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\/953\/test-registry-item\/","og_locale":"en_US","og_type":"article","og_title":"Test Registry Item &#8226; The Lonely Administrator","og_description":"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.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/","og_site_name":"The Lonely Administrator","article_published_time":"2010-10-04T13:00:11+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":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Test Registry Item","datePublished":"2010-10-04T13:00:11+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/"},"wordCount":188,"commentCount":6,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Function","Get-ItemProperty","PowerShell","Registry","transaction"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/","name":"Test Registry Item &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2010-10-04T13:00:11+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/953\/test-registry-item\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Test Registry Item"}]},{"@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":9130,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9130\/configure-sysinternals-eula-acceptance\/","url_meta":{"origin":953,"position":0},"title":"Configure SysInternals EULA Acceptance","author":"Jeffery Hicks","date":"August 24, 2022","format":false,"excerpt":"I just saw a very, very handy thing on Twitter where you can set a registry key that will automatically accept all EULA prompts for the SysInternals tools. I know there is a command-line switch I can use, but I never remember to use it. Setting the registry key appears\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":1078,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1078\/importing-and-exporting-registry-items\/","url_meta":{"origin":953,"position":1},"title":"Importing and Exporting Registry Items","author":"Jeffery Hicks","date":"January 25, 2011","format":false,"excerpt":"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\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":984,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/984\/export-registry\/","url_meta":{"origin":953,"position":2},"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":6672,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6672\/going-down-the-right-path-with-powershell\/","url_meta":{"origin":953,"position":3},"title":"Going Down the Right %PATH% with PowerShell","author":"Jeffery Hicks","date":"April 19, 2019","format":false,"excerpt":"I trust that most of you are aware that the reason it is often easy to run command and programs in Windows, especially items from the command prompt, is thanks to a system environment variable called PATH. When you tell Windows to run a command, without using the complete path\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\/2019\/04\/image_thumb-17.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-17.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-17.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-17.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":53,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/53\/writing-the-registry-in-powershell\/","url_meta":{"origin":953,"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":573,"url":"https:\/\/jdhitsolutions.com\/blog\/commandline\/573\/power-up-your-r2-server-core-shell\/","url_meta":{"origin":953,"position":5},"title":"Power Up your R2 Server Core Shell","author":"Jeffery Hicks","date":"January 27, 2010","format":false,"excerpt":"I've recently started using the Server Core option for my test servers, especially for things like domain controllers. I can get by with smaller disk and memory requirements. Once you get the server configured, there's very little you have to do that actually requires logging on to the server. Which\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/953","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=953"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/953\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}