Set-location example on Page 59 of book

This topic contains 1 reply, has 2 voices, and was last updated by  Olaf Soyk 2 weeks, 5 days ago.

  • Author
    Posts
  • #101637

    Ramon Tan
    Participant

    Sir/Madam,

    I am learning PS from the Book by Jones and Hicks (PS in a month of lunches, 3rd ed.).
    On page 59, I followed the example to set-location as follows:
    > set-location -path hkcu
    and got the error message that "C:\hkcu" does not exist, which is true.
    I must be missing some simple setting, configuration, or ??? I have Windows 7, PS 5.1.
    Any tips, advice or hints would be appreciated.
    — SORRY SORRY — PLEASE IGNORE THIS POST:
    I found out my mistake: I forgot the colon ':' in 'hkcu:'

    Sincerely,
    RTan

  • #101653

    Olaf Soyk
    Participant

    If you like to change the provider as well when changing the location you have to make obvious that it is another drive or provider ... like so

    Set-Location -Path hkcu:

    or provide the provider as well with the path like this:

    Set-Location REGISTRY::HKCU

You must be logged in to reply to this topic.