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


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


Site Updates

PS: Easy checking to see if a key exists

Friday, October 25, 2013 in Powershell (Views: 2007)
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.