MSDN文章纠错-Automating Microsoft SharePoint 2010 with Windows PowerShell 2.0 (book excerpt)
2012-01-24 14:32
666 查看
笔者经过实践, 发现文章Automating Microsoft SharePoint 2010 with Windows PowerShell 2.0 (book excerpt)中的Power Shell有错误.
第一个错误
=======================================
文章错误部分截图:
错误信息:
解释:
New-SPManagedPath分为两种, 一种是带WebApplication参数的, 另一种是带HostHeader参数的.
这里的代码混淆了两种命令, 当然会运行出错.
解决方法
==================
命令中去掉PipeLine输入参数$webApp即可.
第二个错误
=======================================
如果你运行它, 你会发现该命令报错.
原因是name参数后面缺了一个双引号".
这种文章都往MSDN上放, 太坑爹了.
建议MSDN站点提供评论功能, 这样有人发现了错误之后可以进行评论, 以帮助其他人不要再犯同样的错误, 耽误大家的宝贵时间.
参考资料
New-SPManagedPath
http://technet.microsoft.com/en-us/library/ff607693.aspx
第一个错误
=======================================
文章错误部分截图:
错误信息:
PS C:\Users\administrator.VSAT> New-SPManagedPath -RelativeURL "test" -WebApplic
ation "http://sps2010:8080/" -HostHeader -Explicit
New-SPManagedPath : Parameter set cannot be resolved using the specified named
parameters.
At line:1 char:18
+ New-SPManagedPath <<<< -RelativeURL "test" -WebApplication "http://sps2010:8
080/" -HostHeader -Explicit
+ CategoryInfo : InvalidArgument: (:) [New-SPManagedPath], Parame
terBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.SharePoint.Power
Shell.SPCmdletNewManagedPath
ation "http://sps2010:8080/" -HostHeader -Explicit
New-SPManagedPath : Parameter set cannot be resolved using the specified named
parameters.
At line:1 char:18
+ New-SPManagedPath <<<< -RelativeURL "test" -WebApplication "http://sps2010:8
080/" -HostHeader -Explicit
+ CategoryInfo : InvalidArgument: (:) [New-SPManagedPath], Parame
terBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.SharePoint.Power
Shell.SPCmdletNewManagedPath
解释:
New-SPManagedPath分为两种, 一种是带WebApplication参数的, 另一种是带HostHeader参数的.
这里的代码混淆了两种命令, 当然会运行出错.
解决方法
==================
命令中去掉PipeLine输入参数$webApp即可.
第二个错误
=======================================
文章中有代码如下:
$app = New-SPEnterpriseSearchServiceApplication ` -Name “Enterprise Search Hosting Service Application ` -DatabaseServer “spsql1” ` -DatabaseName “SharePoint_Hosting_Search” ` -ApplicationPool $pool ` -Partitioned
如果你运行它, 你会发现该命令报错.
原因是name参数后面缺了一个双引号".
这种文章都往MSDN上放, 太坑爹了.
建议MSDN站点提供评论功能, 这样有人发现了错误之后可以进行评论, 以帮助其他人不要再犯同样的错误, 耽误大家的宝贵时间.
参考资料
New-SPManagedPath
http://technet.microsoft.com/en-us/library/ff607693.aspx
相关文章推荐
- Managing SharePoint 2010 Farm Solutions with Windows PowerShell
- Windows SharePoint Services To Be Open Source With 2007 Microsoft Office Release
- 7 developmnet Project with the 2007 Microsoft Office System and Windows SharePoint 2007翻译(1)-feature
- Deploy WSP with SharePoint 2010 PowerShell
- Visual guide to Windows Live ID authentication with SharePoint 2010 - part 1
- SharePoint 2010 权限提升-SPSecurity.RunWithElevatedPrivileges method (Microsoft.SharePoint)
- [转]Setting a SharePoint 2010 Config DB failover server with PowerShell
- Configuring Alternate Access Mapping in SharePoint 2010 using Windows PowerShell
- SharePoint 2010 最佳实践学习总结------第2章 SharePoint Windows PowerShell指南
- SharePoint 2010 最佳实践学习总结------第2章 SharePoint Windows PowerShell指南
- Adding and Deploying Solutions with PowerShell in SharePoint 2010
- 【SharePoint 2010】将Sharepoint Server 2010部署到WINDOWS 7
- External BLOB/Binary Store for Windows SharePoint Services 3.0 in C#/.NET 2.0 - Part I(转) 把 sharepoint 大文件保存解决方案
- 翻译(一)SharePoint 2007管理入门:Windows SharePoint Service 3.0 and Microsoft Office SharePoint Server 2007
- 翻译(二)SharePoint 2007管理入门:Windows SharePoint Service 3.0 and Microsoft Office SharePoint Server 2007
- [转]How to Integrate SharePoint 2010 with Reporting Services
- SharePoint 2010 查询不以某个字符开头的数据[How to Create a SharePoint “Does Not Begin With” Filtered List View]---计算栏的妙用
- There is not a header with name ServiceContext and namespace http://schemas.microsoft.com/sharepoint/servicecontext in the messa
- Custom an Site Hierachy with TreeNode in SharePoint 2010
- 好文推荐:Development Tools and Techniques for Working with Code in Windows SharePoint Services 3.0