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
Import-Module 'C:\Users\basantp\Documents\PNP Blog Section\Code\SharePointPnPPowerShell2013\SharePointPnP.PowerShell.2013.Commands.dll'; | |
try { | |
$URL='<Please enter your url>' | |
Connect-PnPOnline -Url $URL -CurrentCredentials -ErrorAction Stop | |
Write-host "Site $URL connected" | |
#Working code | |
Add-PnPJavaScriptBlock -Name "myAction" -script ' var ABC = alert("This is my Script block");' -Sequence 20000 -Scope Site | |
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
Import-Module 'C:\Users\basantp\Documents\PNP Blog Section\Code\SharePointPnPPowerShell2013\SharePointPnP.PowerShell.2013.Commands.dll'; | |
try { | |
$path = 'C:\Users\basantp\Documents\PNP Blog Section\Code\Branding' | |
$inputFile = $path + "\SetHomePage.csv" | |
$MyFile = Import-Csv $inputFile | |
foreach ($myRow in $MyFile) { | |
if ($myRow.SiteURL -ne "") { |
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
ContentTypeName | ||
---|---|---|
MyContentType | ||
MyContentType2 | ||
MyContentType3 | ||
MyContentType4 | ||
MyContentType5 |
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
#Dev Import | |
$Path = "C:\SharePointPnPPowerShell2013\" | |
Import-Module '$Path\SharePointPnP.PowerShell.2013.Commands.dll'; | |
#-----Function to create Site Columns----# | |
function CreateSiteColumns($csvPath, $SiteURL) { | |
$Cred = $global:GlobalCred | |
$newUtfFile = "SiteCollectionSiteColumns_utf8.csv"; |
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 Connect([string]$Url) { | |
if ($Url -eq $Global:lastContextUrl) { | |
return | |
} | |
if ($appId -ne $null -and $appSecret -ne $null) { | |
Connect-PnPOnline -Url $Url -AppId $appId -AppSecret $appSecret | |
} | |
else { | |
Connect-PnPOnline -Url $Url | |
} |
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
<AppPermissionRequests AllowAppOnlyPolicy="true"> | |
<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" /> | |
<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" /> | |
<AppPermissionRequest Scope="http://sharepoint/taxonomy " Right="Read" /> | |
</AppPermissionRequests> |
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
$ProgressPreference = "SilentlyContinue" | |
$WarningPreference = "SilentlyContinue" | |
#Import Modudle | |
Import-Module $PSScriptRoot\SharePointPnPPowerShellOnline\SharePointPnPPowerShellOnline.psd1 -ErrorAction SilentlyContinue | |
#Uncomment to run the same script to your local | |
#$env:APPSETTING_PWord="<Passowrd>" | |
#$env:APPSETTING_User="<userName>" |
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
#Please make sure you have installed all the powershell package. | |
Import-Module 'C:\Users\basantp\Documents\PNP Blog Section\Code\SharePointPnPPowerShell2013\SharePointPnP.PowerShell.2013.Commands.dll'; | |
try { | |
Set-PnPTraceLog -On -LogFile 'C:\Users\basantp\Documents\PNP Blog Section\Code\traceoutput.txt' -Level Error -Delimiter "," | |
$Url1 = "https://sharepoint-xxx.com/xx/xxx" | |
Connect-PnPOnline -Url $Url1 -CurrentCredentials -ErrorAction Stop | |
Write-host "Site connected". | |
$Context= Get-PnPContext # Connect and store the context | |
$Web = $Context.Site.RootWeb |
OlderNewer