Mark

Mark

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Mark
    Participant
    Post count: 6

    Yes. I’ve used it for other things. Since the $UserProfile object that it references contains the ‘NTAccount’,’SID’,and ‘ProfilePath’ properties, anything you can use with those (mainly ‘ProfilePath’, I think) is fair game 😉

    Something like this works just fine:

    <code>[scriptblock]$stuffToDo = {
       Copy-File -Path $PathToFile -Destination $($UserProfile.ProfilePath)\AppData\SomeFolder\
    }
    Invoke-HKCUSettingsForAllUsers -RegistrySettings $stuffToDo</code>

    Since this is just a scriptblock that gets run ‘ForEvery’ user profile, and the $UserProfile object is set up internally, you can put anything you want in that scriptblock and it will get run once for every profile. Since the $UserProfile.ProfilePath property is already available then, anything that uses it will get the path of each user profile in turn.

    • This reply was modified 1 month, 3 weeks ago by  Mark. Reason: Still can't get quotes to work properly
  • Mark
    Participant
    Post count: 6

    Thanks. I’m looking forward to migrating.

Viewing 2 posts - 1 through 2 (of 2 total)