我正在尝试获取在文件共享上共享的文件夹列表。目前我有两个测试文件夹:
\\MYPC\Test1
\\MYPC\Test2
Run Code Online (Sandbox Code Playgroud)
这是我目前的代码:
$FileServer = Read-Host "Enter file server to search"
$FolderList = Get-ChildItem -Path $FileServer
Write-Host $FolderList
Run Code Online (Sandbox Code Playgroud)
But this comes up with "cannot find the path". I can see examples of how to do this for \\Server\Share
as the directory, but is it possible to just search the \\Server
?