Get-Child Item

This topic contains 3 replies, has 2 voices, and was last updated by  Bob McCoy 2 years, 5 months ago.

  • Author
  • #34301

    Mark Hammonds

    I have ISE open as admin but still cannot get child items from User profile application Data What am I doing wrong

    Get-ChildItem : Access to the path 'C:\users\108736\AppData\Local\Application Data' is denied.

  • #34303

    Bob McCoy

    Your scenario is a little unclear.
    When you say "I have the ISE open as admin" it can mean one of two things.
    1) I am logged in with an account that is in an administrators group (local or domain).
    2) I launched the ISE form the admin context (Run as Administrator, or from a console window that is already in the Admin context.

    Simply doing #1 will get you access denied since UAC will run it in the lower privilege state. The way you can tell definitively is to run ...

    whoami /priv

    In the lower state you will only have five privileges. In the higher state you will have upwards of 20 (actual count varies by OS).

  • #34304

    Mark Hammonds

    bingo you hit it I am doing run as administrator I will switch to an admin box Gah powershell can be a pain sometimes

  • #34318

    Bob McCoy

    Be careful now. This is NOT a PowerShell issue. It's the way UAC runs in Windows.

You must be logged in to reply to this topic.