Open the PowerShell ISE and create a profile by running the following code:
Open the newly created profile with the following command:
The profile will be open in the PowerShell ISE. Add the following code to the profile:
(If the profile for some reason doesn't open then you can get it here:
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1)
Save the profile.
Next time you open the PowerShell ISE you will have all the Microsoft.SharePoint.PowerShell commandlets.
if (!(test-path $profile.AllUsersAllHosts)) { new-item -type file -path $profile.AllUsersAllHosts-force }
Open the newly created profile with the following command:
psEdit $profile.AllUsersAllHosts
The profile will be open in the PowerShell ISE. Add the following code to the profile:
(If the profile for some reason doesn't open then you can get it here:
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1)
if ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell }
Save the profile.
Next time you open the PowerShell ISE you will have all the Microsoft.SharePoint.PowerShell commandlets.
Well done...
ReplyDeleteVery use full article...