how can i download data from OSM or JOSM automatic with PowerShell for example
If you automate access to the main API, you should use your own unique User Agent string, so that you can be selectively blocked if you make excessive use. I can’t find anything equivalent for Overpass, but rate limits have been applied to IP addresses in the past. For heavy use you should run your own server.
The main API is an editing API, provided for mappers to edit the map. If you have other intended uses of the data, usage of this API is abuse and you should rather use alternative sources like planet.osm.org or geofabrik downloads or the overpass api (and many more, according to what you need, everything, regional extract, thematic extract, etc.) and eventually filter this according to your needs.