The term '​$LoginPage' is not recognized as the name of a cmdlet, function, script file, or operable program

Hi guys,
I’m getting a strange error when I run the script.
I cannot figure out the reason for this error.
I’m working inside VS Code.
I even opened the file in a notepad to see if VS Code is adding some weird characters to my script (see error message) and I didn’t find anything.

I have been working on this for the past hour :frowning: any new insight is much appreciated.

Please see image of my code.

This could be an encoding thing. Can you try to delete New-UDLoginPage and typing again? Sometimes if you copy a script from the internet the - might not be a - at all. Especially if it made it into outlook or a word doc.

Worth a shot

Hi Adam,
sorry for my delay response.
That was the solution, I had to retype it.
Thank you

The good old “dash” vs “hyphen”.