Brace the posts on a pole barn for wind resistance with steel cables, wall sheathing, or wooden X braces. This is necessary to keep the posts from swaying. Once bracing has been installed, the posts are locked into position. They need to be temporarily braced with two braces (one on each axis) to hold the post plumb.
The closer to the top, and the closer to the bottom a brace can be positioned, the more it will hold. Most of the time, it is just not possible to go from the top to the bottom simply because of clearance issues. Even a very short brace is better than no brace. If your building is subject to a building inspection, then consult with your local inspector to find out the requirements of the building code.
Posts should always be set in the ground with concrete poured around them. The larger the diameter and the deeper the hole, the more it will hold. This is important for open sided buildings, that have very short braces, such as pavilions.
X Brace the Posts with Wood
Wooden X braces are often crafted from the same material as the posts they will be bracing. For example, if the posts are 6×6, then the bracing can be made from 6×6.
Remember that using nails for this application is asking for trouble. The constant flexing of the post will eventually work the nails loose. Always use lag bolts or carriage bolts to firmly attach wooden braces.
Since a solid brace like this is rigid by nature, it will hold both under compression and tension. This means that one brace of this type will hold an entire wall. However, I recommend using as many braces as practical.
Steel Cable Bracing
Steel cables work well for applications where wooden X braces would be just too long, They work much like guy lines holding a tent or a tower.
Use 5/16″cable for a minimum. Clips make the fabrication of loops a snap. Cables can be prefabbed on the ground and tightened by using an extra long eye bolt. This technique is much cheaper than using turnbuckles.
Other Forms of Bracing
Although metal siding is not recognized by building officials for being a wall brace, it will hold a wall almost as good as 7/16″ osb on a residential framing application. Other forms of siding, including board and batten, hold walls pretty good as well, but are frowned upon by building inspectors. They look at it the way as they would if you are using roofing metal for siding. The thing about it is, if the wall is covered with siding, then there is enough room behind it for bracing.
Some building designs incorporate no apparent bracing of any kind. Trust me, there is something bracing the posts.