Nov 21 2016 12:17 PM
I am able to to register a block but calling the booMonster function is not possible as the custom javascript library is not loaded yet? Can I load a Block from a javascript file?
I am trying have a function called on every pages?
#
#
$ScriptName = "SayBoo"
$scriptBlock = "booMonster('monsterhere');"
try
{
#Connect to the SPO site
Connect-PNPOnline -Url https://myteams.qqq.com/sites/tmnaisa/IS/PlayArea -Credential sp
#Remove script if added before
Remove-PnPJavaScriptLink -Name $ScriptName
#Add the script
Add-PnPJavaScriptLink -Name $ScriptName -script $scriptBlock -Sequence 2000
}
catch
{
Write-Host "$_.Exception.Message"
}
Write-Host "Completed successfully." -ForegroundColor Green
Nov 21 2016 10:25 PM