Can you make it smarter? Of course!
To make it smarter in the just once term just type the following code in the ISE on your sever (if the ISE isn't loaded on your server just add it as a Feature from Server Manager)
Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell
But you'll have to do that every time you open the ISE. To make the ISE permanently smarter on that system you can create a profile that loads this automatically
(Does this take anyone else back to autoexec.bat?)
if (!(test-path $profile.AllUsersAllHosts))
{new-item -type file -path $profile.AllUsersAllHosts-force}
psedit $profile.allusersallhosts
If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{ Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell }
Save profile.ps1 and close PowerShell ISE
Reopen ISE and verify success with the following command:
Get-Command Get-SP*
No comments:
Post a Comment