当我运行以下脚本时,它返回:@{Name=<Usersname>} not found
Foreach ($object in Get-childitem "\\HomeDriveServer\home$\" | select Name)
{
$userAccount = get-aduser -Filter {SamAccountName -like "*$object*"}
if($userAccount -eq $null)
{
write-host "$object not found"
}
else
{
write-host "$object found"
}
}
Get-childitem "\\HomeDriveServer\home$\" | select Name
返回没有@{Name=
XXX的文件夹名称列表}
为什么会出现@{Name=
XXX }
,我该如何摆脱它?
谢谢