首页 > 系统服务 > 详细

在Powershell ISE中添加sharepoint的智能提示,Enable SharePoint PowerShell Commandlets in the PowerShell ISE

时间:2015-12-23 10:42:29      阅读:159      评论:0      收藏:0      [点我收藏+]

Powershell ISE在默认状态下有一个不好的地方就是不会显示关于SharePoint的一些智能提示,例如你写一个"get-"后面提示的选项里没有sp开头的一些对象。于是找了一下解决方案。

首先打开Powershell ISE, 把下面的代码拷贝到ISE中

 1 if (!(test-path $profile )) 
 2 { 
 3     new-item -type file -path $profile -force 
 4 } 
 5  
 6 
 7 $cmd = ‘if((Get-PSSnapin | Where-Object {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) 
 8 { 
 9     Add-PSSnapIn "Microsoft.SharePoint.Powershell" 
10 }‘
11 
12 out-file -FilePath $profile -InputObject $cmd -Append

运行以上代码,关闭ISE,然后在重新打开,你的ISE就会把关于SharePoint的snapin加载进来了。

在Powershell ISE中添加sharepoint的智能提示,Enable SharePoint PowerShell Commandlets in the PowerShell ISE

原文:http://www.cnblogs.com/cwyang/p/5069031.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!