What is the difference between the following commands in PowerShell?
Get-ChildItem C:\Users -Directory
Get-ChildItem C:\Users | Where-Object {$_.PSIsContainer -eq $true}
They both seem to give the same results. Is there a difference at all?
Update:
I have just started learning powershell and I am not familiar with most of terminology. The results on both commands are like the following:
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 7.9.2021 22.35 Administrator
d----- 7.9.2021 15.40 MyDevice
d-r--- 6.5.2020 11.59 Public
d----- 7.9.2021 22.45 student