1
在PowerShell腳本中,我想獲取所有SPWeb對象。爲什麼這兩個powershell命令不會返回相同的結果?
如果我使用這個命令:
get-spsite | get-spweb
我沒有得到比命令相同的結果:
get-spsite | foreach {Get-SpWeb -Site $_ }
[編輯]以下命令也在努力,甚至在限額默認值爲200:
get-spsite | get-spweb -Limit All
第二個命令返回所有的Web,其中第一個跳過其中的一些(在我的情況下,企業維基站點和搜索中心站點與OWA Web緩存一起被跳過)
爲什麼?
實際的輸出如下:
PS C:\Windows\system32> get-spsite | get-spweb
Url
---
http://clients
http://clients/sites/Office_Viewing_Service_Cache
http://clients/xxxxxxx
http://intranet
http://intranet/PressReleases
http://intranet/Search
http://intranet/wiki
http://intranet/sites/Office_Viewing_Service_Cache
http://my
http://my/personnel/yyyyy
http://my/sites/broadcast
http://my/sites/Office_Viewing_Service_Cache
http://projets
http://projets/sites/zzzzzz
http://projets/sites/zzzzzz/gedqualite
http://projets/sites/Office_Viewing_Service_Cache
http://projets/sites/xxxxxxx
http://projets/sites/xxxxxxx/wwwww
http://projets/tfs/Protos
http://projets/tfs/Protos/pokerstars
PS C:\Windows\system32> get-spsite | get-spweb -Limit all
Url
---
http://clients
http://clients/sites/Office_Viewing_Service_Cache
http://clients/xxxxxxx
http://intranet
http://intranet/PressReleases
http://intranet/Search
http://intranet/wiki
http://intranet/sites/Office_Viewing_Service_Cache
http://my
http://my/personnel/yyyyy
http://my/sites/broadcast
http://my/sites/Office_Viewing_Service_Cache
http://projets
http://projets/sites/zzzzzz
http://projets/sites/zzzzzz/gedqualite
http://projets/sites/Office_Viewing_Service_Cache
http://projets/sites/xxxxxxx
http://projets/sites/xxxxxxx/wwwww
http://projets/tfs/Protos
http://projets/tfs/Protos/pokerstars
http://search
http://search/sites/Office_Viewing_Service_Cache
http://wiki
http://wiki/sites/Office_Viewing_Service_Cache
不,只有20在農場 – 2011-03-17 12:51:24
奇怪的是,命令'get-spsite | get-spweb -Limit All'正在返回所有網絡 – 2011-03-17 12:54:16
我已經添加了命令的實際輸出(匿名數據,但所有結果都在這裏) – 2011-03-17 12:58:31