The formal powers of the executive are exercised through the Executive Council, which consists of all ministers plus the Governor-General. When the Executive Council resolves to issue an order, and the order is signed by the Governor-General, it becomes legally binding.
A minister is generally charged with supervising a particular aspect of the government's activities, such as the provision of health services (Minister of Health) or the upkeep of law enforcement (Minister of Police). Sometimes, people may be appointed ministers without being given any specific role — they are known as ministers without portfolio. Such appointments have become rare today, although sometimes a person may be appointed to a sinecure portfolio such as "Minister of State" for similar purposes.
The appointment of ministers is officially made by the Governor-General, who must sign a ministerial warrant before it officially comes into effect. Governors-General appoint or discharge ministers on the basis of advice from Prime Ministers, who are themselves appointed by the Governor-General on the basis of whether they have the confidence of Parliament. The recommendations that a Prime Minister chooses to give are theoretically their own affair, but the political party (or parties) behind them will almost certainly have views on the matter, and most recommendations are made only after negotiation and bargaining. Different parties have different mechanisms for this - the Labour Party, for example, has provision for caucus to select ministers, while in the National Party, a Prime Minister theoretically has greater authority to make their own selections.
Originally, the Executive Council functioned as an advisory group to the Governor, and ministerial functions were performed appointed officials, not politicians. The various "ministers" serving on the Council, such as the Colonial Secretary (Andrew Sinclair since 1844) and the Colonial Treasurer (Alexander Shepherd since 1842), reported to the Governor. When Parliament was established, however, many believed that they would soon replace these appointed officials, with ministerial positions being given to members of Parliament instead. The Acting Governor, Robert Wynyard, did not agree, however, saying that the levers of government could not be turned over to Parliament without approval from Britain. The issue was controversial, and ended with the Acting Governor attempting (with only partial success) to suspend the 1st New Zealand Parliament.