zoukankan      html  css  js  c++  java
  • 在Powershell ISE中添加sharepoint的智能提示,Enable SharePoint PowerShell Commandlets in the PowerShell ISE

    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加载进来了。

  • 相关阅读:
    1、如何使用Azure Rest API创建虚拟机
    Ansible---2的Roles使用
    linux下的shell脚本
    生成器 yield和协程
    xshell
    markdown的使用
    加密
    Hbuilder打包app
    尾递归
    jupyter
  • 原文地址:https://www.cnblogs.com/cwyang/p/5069031.html
Copyright © 2011-2022 走看看