Wed. Jun 8th, 2022
Function RemoveListfromQuickLaunchPnP
{
    param(
        [Parameter(Mandatory = $true)][string]$ListName
    )

try
{
    $OnQuickLaunch = $False
    #Get the context
    $Context = Get-PnPContext
    #Get the List
    $List = Get-PnPList -Identity $ListName
    #Set On Quick Launch Properties
    $List.OnQuickLaunch = $OnQuickLaunch
    $List.Update() 
    $Context.ExecuteQuery()
    write-host -f yellow "Removed library $($ListName) from QuickLaunch"
}Catch
{
            write-host Could not remove library $($ListName) from QuickLaunch - $_.Exception.Message -ForegroundColor Red
            $e = $_.Exception
            $line = $_.InvocationInfo.ScriptLineNumber
            $msg = $e.Message
}

}

This website uses cookies. By continuing to use this site, you accept our use of cookies.