Set-location example on Page 59 of book

Welcome Forums General PowerShell Q&A Set-location example on Page 59 of book

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
6 months, 1 week ago.

  • Author
    Posts
  • #101637

    Participant
    Points: 178
    Rank: 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

    Participant
    Points: 241
    Helping Hand
    Rank: 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

The topic ‘Set-location example on Page 59 of book’ is closed to new replies.