Hi,
A good way to start is just like you're doing, copying the win_ping file. I'd recommend using a custom library path like J H describes above.
A module consists of two files, a .ps1 file which is the actual script and a corresponding .py file. On Windows the py file is only used for documentation, but it still needs to be available.
Looking at the documentation for win_ping that module only lists "data" as an acceptable parameter, so passing "var" to it won't work without modification.
One thing that can easily throw you when getting started with ansible is the yml syntax. Yml uses indenting to organize stuff into arrays/lists, so if your indentation is wrong you'll get strange errors.
In your example, this should work:
---
- name: Test windows
hosts: all
tasks:
- win_test:
data: "Hello from win_test"
- name: Another way to specify a play
win_test: data="Hello2 from win_test"