First create the script in a text editor like notepad and save that file with “.PS1” extension.
Execute the script by typing the complete path of the script, or if we are in the current directory, attach the current directory with a period pursued by a backslash.