A couple of things.... When you post code, please use the Code Sample icon to format it. That's the 101010 icon. Otherwise the web site removes certain characters and treats some as formatting character.
Don't do this..
ForEach($_ in $a)
The "dollar underscore" is the pipeline variable. While that code might work, I would recommend using your own variable name to avoid confusion.
ForEach($SiteName in $a)
It looks like you are doing a copy/paste of a multiline script into a PS window. Don't do that either. Save the script as a .ps1 file and run it. Or load the code into Powershell_ISE and run it from there.
3 days ago, you apparently had a working script that verified that the source folder existed. All you needed to do was add one more line to execute the Move_PnPFolder cmdlet. Did you do that? Did you get an error?