Anyone know how i can write a script that will pin a shortcut into the start menu?
No luck unfortunately. You've used this on windows 7 or only windows 10?
Nope, didn't try it on win7. Try to execute function first and see do you get any error? There should be if it doesn't work in win7.
Looks like the function itself works. Any other way i can test to see what step is causing it to fail?