Date and Month display

To change the SharePoint Online List URL

<#
******-----------------------------------------------------------------------******
Author          -> Shiv Mangal Singh
Date            -> 27 th June- 2017
Description     -> To change the SharePoint Online List URL
Site URL  --> $site ="https://ms.connect.contoso/sites/abc/test/"

******-----------------------------------------------------------------------******
 #>
#Import-Module ‘C:\Program Files\msPoint Online Management Shell\Microsoft.Online.msPoint.PowerShell’ -DisableNameChecking

Add-Type -Path "C:\Program Files\msPoint Online Management Shell\Microsoft.Online.msPoint.PowerShell\Microsoft.msPoint.Client.dll"
Add-Type -Path "C:\Program Files\msPoint Online Management Shell\Microsoft.Online.msPoint.PowerShell\Microsoft.msPoint.Client.Runtime.dll"

$userCredential = Get-Credential
$SPOCredentials = New-Object Microsoft.msPoint.Client.msPointOnlineCredentials($userCredential.UserName, $userCredential.Password)
$site ="https://ms.connect.contoso/sites/abc/test/"
$ctx = New-Object Microsoft.msPoint.Client.ClientContext($site)
$ctx.Credentials = $SPOCredentials
$web = $ctx.Web
$ctx.Load($web)
$ctx.Load($web.Lists)
$ctx.ExecuteQuery()
$listname = $web.Lists.GetByTitle("Test_Inventory1")
$ctx.Load($listname)
$ctx.ExecuteQuery()
#Fetching the RootFolder of the list
$ctx.Load($listname.RootFolder)
$ctx.ExecuteQuery()
$rootfolder = $listname.RootFolder.ServerRelativeUrl
Write-Host $rootfolder
$listname.RootFolder.MoveTo("Lists/Inventory Data")

No comments:

Post a Comment