StevensNet.com

...Because someone's gotta tell the story...

Blogs

To return to the main Blog List, click Full Blog Listing.

Tags

PowerShell
Registry
Windows

PS: Easy checking to see if a key exists

Friday, October 25, 2013 in Powershell (Views: 1268)
This is a quick and easy way to check if a registry key exists in PowerShell. Kind of inspired by my last blog, which identifies the registry key to see if a reboot is required post Windows Update.

Here is how you can do this:
$a=test-path "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired"
if ($a -eq "True"){write-host "Exists, insert your actions here."}
else {write-host "Doesn't exist, nothing to do..."}


Happy rebooting...

 

Related Blogs You May Be Interested In:


To leave a comment, please log in and/or register.