Home Dashboard Directory Help
Search

Powershell 3.0 Test-Path -PathType Container always returns false for UNC path by ajrechk


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 786664
Opened: 5/9/2013 11:47:58 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

When running Test-Path "known UNC folder path" -PathType Container in server 2012 it always returns false. I run the same command on the same known folder from a server 2008 r2 or windows 7 box, and it returns True when it is a folder, and false when not.
Details
Sign in to post a comment.
Posted by Randy Pitkin on 12/9/2013 at 12:26 PM
I am running into this issue with shares regardless of -pathtype or which parameter -Literalpath or -path. Even when the host "PowerGui" is providing intellisense and poplating the path. Test-path returns False when executing the command.
Elevating to Administrator changes the behavior.
Sign in to post a workaround.
Posted by ajrechk on 5/9/2013 at 11:59 AM
Even though UAC is off, and powershell title windows showed "administrator", i still had to run as Administrator when opening powershell. Now the command works, and result is expected