|
|
@ -71,18 +71,15 @@ If (Test-Path $path)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Else
|
|
|
|
Else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
# Only files have the .Directory attribute.
|
|
|
|
If ( $state -eq "directory" -and -not $fileinfo.PsIsContainer )
|
|
|
|
If ( $state -eq "directory" -and $fileinfo.Directory )
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Fail-Json (New-Object psobject) "path is not a directory"
|
|
|
|
Fail-Json (New-Object psobject) "path is not a directory"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Only files have the .Directory attribute.
|
|
|
|
If ( $state -eq "file" -and $fileinfo.PsIsContainer )
|
|
|
|
If ( $state -eq "file" -and -not $fileinfo.Directory )
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Fail-Json (New-Object psobject) "path is not a file"
|
|
|
|
Fail-Json (New-Object psobject) "path is not a file"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Else
|
|
|
|
Else
|
|
|
|