How to Run PowerShell Scripts
Microsoft recommends and endorses the use of PowerShell scripts over .dat files.
The PowerShell ISE editor is part of standard Window’s installs on most desktop and servers.
See also pages on Microsoft PowerShell
Run from the PowerShell Editor (PowerShell ISE)
In Windows File Explorer right click on the powershell script file (.ps1) > click Edit
PowerShell ISE should run. The PowerShell ISE can both edit and run Powershell scripts.
Edit the script as appropriate.
Click the green Run button in the Toolbar or F5.
Run Powershell from the Command Line
powershell -file <script name.ps1>