This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try{ | |
#Loading SharePoint Client side namespaces | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll' | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll' | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll' | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll' | |
} | |
catch { | |
Throw "Unable to load SharePoint Client runtime" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Load SharePoint client assemblies | |
# | |
Try{ | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll' | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll' | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll' | |
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll' | |
} | |
catch { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Check-ListExists() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][string]$url, | |
[Parameter(Mandatory=$true)][System.Net.NetworkCredential]$credentials, | |
[Parameter(Mandatory=$true)][string]$listName | |
) | |
begin{ | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-PermissionsOnList() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][string]$url, | |
[Parameter(Mandatory=$true)][System.Net.NetworkCredential]$credentials, | |
[Parameter(Mandatory=$true)][string]$listName, | |
[Parameter(Mandatory=$true)][string]$GroupName, | |
[Parameter(Mandatory=$true)][string]$Roletype | |
) | |
begin{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Disable-VersioningOnList() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][string]$url, | |
[Parameter(Mandatory=$true)][System.Net.NetworkCredential]$credentials, | |
[Parameter(Mandatory=$true)][string]$listName | |
) | |
begin{ | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Delete-ListView() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][string]$url, | |
[Parameter(Mandatory=$false)][System.Net.NetworkCredential]$credentials, | |
[Parameter(Mandatory=$true)][string]$listName, | |
[Parameter(Mandatory=$true)][string]$viewName | |
) | |
begin{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Create-ListView() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][string]$url, | |
[Parameter(Mandatory=$false)][System.Net.NetworkCredential]$credentials, | |
[Parameter(Mandatory=$true)][string]$listName, | |
[Parameter(Mandatory=$true)][string]$viewName | |
) | |
begin{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Remove-ItemContentTypeFromAList(){ | |
#delete item content type from list | |
Add-PSSnapin "Microsoft.SharePoint.PowerShell" | |
$web = Get-SPWeb "http://YourSite.com" | |
$list = $web.Lists["Your List Name"] | |
$ctToRemove = $list.ContentTypes["Item"] | |
if($ctToRemove) | |
{ | |
Write-Host "Item Content Type Exist ready to delete" | |
$list.ContentTypes.Delete($ctToRemove.Id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Change-DisplayNameOfField() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][string]$url, | |
[Parameter(Mandatory=$false)][System.Net.NetworkCredential]$credentials, | |
[Parameter(Mandatory=$true)][string]$listName, | |
[Parameter(Mandatory=$true)][string]$fieldName, | |
[Parameter(Mandatory=$true)][string]$displayName | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Check-ColumnExists() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][string]$url, | |
[Parameter(Mandatory=$true)][System.Net.NetworkCredential]$credentials, | |
[Parameter(Mandatory=$true)][string]$listName, | |
[Parameter(Mandatory=$true)][string]$fieldName | |
) | |
begin{ | |
try |
OlderNewer