You can find instructions on how to create and successfully execute your first PowerShell script file on Windows 10 in a tutorial published by Windows Central.
How to create and run a PowerShell script file on Windows 10
If you're getting started with PowerShell, this guide will help you to create and run your first script on Windows 10.
How to create and run a PowerShell script file on Windows 10