PnP PowerShell to Add Link to Quick Launch:
Add-PnPNavigationNode -Title "Contoso" -Url "http://contoso.sharepoint.com/sites/contoso/" -Location "QuickLaunch"
PnP PowerShell to Remove Link to Quick Launch:
Remove-PnPNavigationNode -Title Recent -Location QuickLaunch
Here is the PnP PowerShell script to add link to Quick Launch:
#Config Variables
$SiteURL = "https://crescenttech.sharepoint.com/us"
#Get Credentials to connect
$Cred = Get-Credential
Try {
#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
#Add a Link to Quick Launch Navigation
Add-PnPNavigationNode -Title "Support Center" -Url "http://support.crescent.com" -Location "QuickLaunch"
#Get the Navigation node "Support Center"
$ParentID = Get-PnPNavigationNode -Location QuickLaunch | Where {$_.Title -eq "Support Center"} | Select -ExpandProperty ID
#Add a link under "Support Center
Add-PnPNavigationNode -Title "Application Support" -Url "http://support.crescent.com/apps" -Location "QuickLaunch" -Parent $ParentID
Write-host "Quick Launch Links Added Successfully!" -f Green
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
More information, please refer to the following articles:
========================== Updated Answer =========================
Please run the following PnP PowerShell script:
#Connect to Site
$SiteURL = "https://domain.sharepoint.com/sites/Echo"
$Cred = Get-Credential
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
#Retrieve all web parts used in modern site pages.
$page = Get-PnPClientSidePage -Identity "Home.aspx"
$WebParts = $page.Controls
# if there are more than one webparts
foreach($webpart in $webparts){
Write-Host "Title: " $webpart.Title
Write-Host "WebPart Id: " $webpart.InstanceId
}

Then, please run the following command to remove webpart.
#Remove webpart
Remove-PnPClientSideComponent -Page $page -InstanceId 418ba70b-4cf7-410a-a5fd-ea38386915ac
