The post below explains a very convenient way to add SharePoint snap in to powershell windows on dev server.
In brief:
https://blogs.msdn.microsoft.com/kaevans/2011/11/14/add-microsoft-sharepoint-powershell-snap-in-to-all-powershell-windows/
In brief:
- Run following command in Powershell ISE
- if (!(test-path $profile.AllUsersAllHosts)) {new-item -type file -path $profile.AllUsersAllHosts –force} powershell_ise $profile.AllUsersAllHosts
- Append following code to the newly open powershell file
- $ver = $host | select version if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"} if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" }
Also, you might like the environment path to include some of the key locations e.g.
$env:Path = $env:Path + "C:\Program Files
\Common Files\Microsoft Shared\Web Server Extensions\15\Bin;C:\Windows\System32\inetsrv\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64"
https://blogs.msdn.microsoft.com/kaevans/2011/11/14/add-microsoft-sharepoint-powershell-snap-in-to-all-powershell-windows/
No comments:
Post a Comment