小编The*_*Woo的帖子

PowerShell 获取共享文件夹列表

我正在尝试获取在文件共享上共享的文件夹列表。目前我有两个测试文件夹:

\\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?

powershell shared-folders powershell-3.0

24
推荐指数
3
解决办法
17万
查看次数