0

I used pushd \\network\drive\path to move into this drive in powershell. Then I used Get-ChildItem to check to which folders I can move from here. Unfortunately the results of this command is empty, while there is a lot of folders on my drive. What is the reason? I ran Powershell as administrator, without administrator rule there is no problem

8
  • You need to provide way more information than that. Explain the differences. Which PS version are you using? Are you dealing with hidden folders where -Force is necessary?
    – megamorf
    Apr 21, 2022 at 17:05
  • is that your gci call verbatim? if you run pwd are you actually in the directory you think you are? Apr 21, 2022 at 17:08
  • 1
    [1] the pushd command DOES NOT change your filesystem location. all it does is adds ("pushes") the current location onto a location stack. ///// [2] the correct "change dir" command is Set-Location. ///// [3] you really otta always use the -Path or -LiteralPath parameters with Get-ChildItem ... it is far safer AND easier to debug.
    – Lee_Dailey
    Apr 21, 2022 at 17:15
  • @Lee_Dailey pushd should work. Powershell is perfectly capable of. An empty dir means lack of permissions to view content but not to navigate there.
    – LPChip
    Apr 21, 2022 at 17:36
  • Does this answer your question? SMB shares not found on Windows 10 laptop
    – harrymc
    Apr 21, 2022 at 18:59

1 Answer 1

0

This is not working because your administrator user lacks the privileges to view the content of the folder on this network share.

This is explained by the simple reason that it works without administrator, but not while using powershell as administrator.

I have confirmed this by making an alteration to one of my network shares. My user has rights but the user Administrator does not. I can view it the folder using pushd and dir as normal user, but not as admin. (and yes, dir is an alias for get-childitem)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .