GitHub Icon Image
GitHub

Generate Markdown Report of LCIDs

Summary

This is a simple report listing out the language IDs (LCIDs) of a SharePoint site and generated a markdown formatted table of the output. After this, the report is output to the shell and copied to the clipboard.

Example Screenshot

  • PnP PowerShell
  • CLI for Microsoft 365

Connect-PnPOnline -Url "https://contoso.sharepoint.com"

$languages = (Get-PnPWeb -Includes RegionalSettings.InstalledLanguages).RegionalSettings.InstalledLanguages | `
        Sort-Object -Property "DisplayName"

# Markdown format
$markdown = ""
$markdown += "| Name | Language Tag | LCID |`n"
$markdown += "|------|--------------|------|`n"

$languages | foreach-object{ $markdown += "| $($_.DisplayName) | $($_.LanguageTag) | $($_.LCID) |`n"} 

Write-Host $markdown

# Copy to clipboard
$markdown | clip

Write-Host "Script Complete! :)" -ForegroundColor Green

Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell


$m365Status = m365 status
if ($m365Status -match "Logged Out") {
    m365 login
}

$languages = m365 spo web installedlanguage list --webUrl 'https://contoso.sharepoint.com'
$languages = $languages | ConvertFrom-Json

# Markdown format
$markdown = ""
$markdown += "| Name | Language Tag | LCID |`n"
$markdown += "|------|--------------|------|`n"

$languages | foreach-object{ $markdown += "| $($_.DisplayName) | $($_.LanguageTag) | $($_.LCID) |`n"} 

Write-Host $markdown

# Copy to clipboard
$markdown | clip

Write-Host "Script Complete! :)" -ForegroundColor Green

Check out the CLI for Microsoft 365 to learn more at: https://aka.ms/cli-m365

Contributors

Author(s)
Paul Bullock
Adam Wójcik

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Back to top Script Samples
Generated by DocFX with Material UI