SharePoint online 默认是现代视图,我们可以通过Powershell命令切换默认视图。
以下,是完成的Powershell命令:
Add-Type -Path "C:\Users\ # All strings in braces <>are placeholders that you must replace with the appropriate strings. $webUrl = 'https:// [Microsoft.SharePoint.Client.ClientContext]$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl) $first = $true 复制代码 如果保存ps1文件,请注意 Note: You can use a different file name, but you must save the file as an ANSI-encoded text file whose extension is .ps1
复制代码
# This file uses CSOM. Replace the paths below with the path to CSOM on this computer.
# If CSOM is in the user's downloads folder, you only have to replace the
Add-Type -Path "C:\Users\
$username = '
$password = Read-Host -Prompt "Password for $username" -AsSecureString
$clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$site = $clientContext.Site;
$customActions = $site.UserCustomActions
$clientContext.Load($customActions)
$clientContext.ExecuteQuery()
foreach($customAction in $customActions)
{
if($customAction.Location -eq "scriptlink" -and -Not ([string]::IsNullOrEmpty($customAction.ScriptBlock)))
{
if ($first)
{
Echo " "
Echo ($webUrl + " has the following inline JavaScript custom actions")
$first = $false
}
Echo $customAction.Title
}
}
……