You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -774,22 +774,33 @@ class PathQuestion : Question {
774
774
break
775
775
}
776
776
777
-
if (Test-Path$this.response-PathType $this.type) {
777
+
$pathType='Leaf'
778
+
if ($this.isDirectory) {
779
+
$pathType='Container'
780
+
}
781
+
782
+
if (Test-Path$this.response-PathType $pathType) {
783
+
break
784
+
}
785
+
786
+
$path=$this.response.Trim("'").Trim('"')
787
+
if (Test-Path$path-PathType $pathType) {
788
+
$this.response=$path
778
789
break
779
790
}
780
791
781
-
$pathType='file'
782
-
if ($this.type-eq [microsoft.powershell.commands.testpathtype]::Container) {
783
-
$pathType='directory'
792
+
$pathTypeMessage='file'
793
+
if ($this.isDirectory) {
794
+
$pathTypeMessage='directory'
784
795
}
785
-
Write-Host"Unable to read $pathType '$($this.response)' - the $pathType may not exist or you may not have permissions to read it - please enter another $pathType path"
796
+
Write-Host"Unable to read $pathTypeMessage '$($this.response)' - the $pathTypeMessage may not exist or you may not have permissions to read it - please enter another $pathTypeMessage path"
0 commit comments