PowerShell Tips Search Get Registry path _powershell

Source: Internet
Author: User

In the previous tip we explained how to convert a PS-built path format into a real path. An example is presented here. This code recursively obtains from HKEY_CURRENT_USER all the keys that contain the "PowerShell" affix (a simple substitution query affix will get anything you want to query)

Copy Code code as follows:
Get-childitem-path hkcu:\-include *powershell*-recurse-erroraction silentlycontinue| Select-object-property *path* | Out-gridview

This code prints out all the attributes that contain the "path", and you will see that there are two attributes in the registry containing the keywords: Pspath and psparentpath all use the PS built-in path format.

To simply remove the path in the registry to meet your query criteria, you try this:

Copy Code code as follows:
Get-childitem-path hkcu:\-include *powershell*-recurse-erroraction silentlycontinue| Foreach-object {Convert-path-path $_. Pspath}

Supports all PS versions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.