Remove-SSPSiteScript.ps1
function Remove-SSPSiteScript { param( $title, $content, $connection = (Get-PnPConnection) ) $scripts = Get-PnPSiteScript -Connection $connection if ($title) { $scripts = $scripts | Where-Object { $_.Title -eq $title } } foreach ($s in $scripts) { Remove-PnpSiteScript -Identity $s.Id -Connection $connection -Force } } |