creating batch file to kick off powershell script in different versions of windows with different commands

I needed the ability to have a powershell script execute specific ways for specific versions of windows, so after some googling, I hodge podged this. Essentially you will run this script first, as a cmd, or batch file: @echo off setlocal for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j REM Windows 10 ...