Added ErrorActionPreference variable

* ErrorActionPreference is a powershell variable that dictates how errors should be handled. By default its set to "Continue". Setting it to "Stop" sis the equivalent of -e (Stop on error) in BASH.
* updated dependencies.tsv to include the WriteYaml windows fix in utils
state/apiserver/common: refactor AuthAlways

This branch prepares for an upcoming change to make AuthAlways more strict by splitting AuthAlways(true/false) into two helpers, AuthAlways and AuthNever which take no arguements.

As the value passed to AuthAlways was a constant in all but one case this has made the code easier to read in the common case.
sentences end with a full stop.
Tags are now validated, so blank and spaces are no longer valid.
Merge pull request #531 from davecheney/175-state-apiserver-common-cleanup-authalways-authnever

state/apiserver/common: refactor AuthAlways

This branch prepares for an upcoming change to make AuthAlways more strict by splitting `AuthAlways(true/false)` into two helpers, `AuthAlways` and `AuthNever` which take no arguments.

As the value passed to `AuthAlways`was a constant in all but one case this has made the code easier to read in the common case.
New top-level package: wrench

This package provides simple way for any part of Juju to check if a
"wrench should be dropped in the works" at some part of Juju's
execution. It checks $datadir/wrench for files which signal that
something should break, performing permission and error checking, and
logging.

The idea is that judicious calls to wrench.IsActive can be permanently
left in the code to aid manual and CI testing.
Disable wrench during test runs

Don't let stray wrench files that may be present on a developer's
system from uninentionally affecting behaviour during unit tests.
Merge pull request #508 from mjs/wrench

New top-level package: wrench

This tiny package provides simple way for any part of Juju to check if a "wrench should be dropped in the works" at some part of Juju's execution. It checks $datadir/wrench for files which signal that something should break, performing some error checking and logging.

The idea is that judicious calls to wrench.IsEnabled can be permanently left in the code to aid manual and CI testing.
state/apiserver/common: drop EnvironWatcher.canWatch

In all cases canWatch was being populated with the common.AuthAlways factory; in effect canWatch(anything) would always return true.

The only case where it did not return true was in our unit test cases which would force the value to be false to generate a suprious ErrPerm which was then validated by the tests.
Merge pull request #532 from howbazaar/update-names

Tags are now validated, so blank and spaces are no longer valid.

Update to the latest names version.

User tags are now validated when created, so a few places had to change to make this work.
remove unnecessary logic from GetAuthFromKind
state/apiserver/provisioner: refactor canWatchMachines logic
Merge pull request #533 from davecheney/177-state-apiserver-common-environwatcher-drop-canwatch

state/apiserver/common: drop EnvironWatcher.canWatch

In all cases canWatch was being populated with the common.AuthAlways factory; in effect canWatch(anything) would always return true.

The only case where it did not return true was in our unit test cases which would force the value to be false to generate a suprious ErrPerm which was then validated by the tests.
Merge pull request #465 from gabriel-samfira/windows-services

Enable windows service in juju

On windows, services need to be able to respond to events in order to be compatible with SCM (Service Control Manager). This PR detects whether we are running from a command line or if we are trying to run it as a service, and executes the appropriate routine.

* Added $ErrorActionPreference="Stop", in all powershell commands in github.com/juju/juju/service/windows. ErrorActionPreference is a powershell variable that dictates how errors should be handled. By default its set to "Continue". Setting it to "Stop" is the equivalent of -e (Stop on error) in BASH.
* updated dependencies.tsv to include the WriteYaml windows fix in utils, a fix for named pipes and to add the windows service package
Merge pull request #534 from davecheney/178-state-apiserver-provisioner-refactor-canwatchmachines-logic

state/apiserver/provisioner: refactor canWatchMachines logic

This proposal removes the last deliberate use of `canWatch("")` in the apiserver.

There are some inadvertent uses where the tag string passed to `canWatch` will be addressed in the next proposal.
environs/cloudinit: use actual tools version in bootstrap agent.conf

The upgradedToVersion field in the bootstrap machine agent's config
will now match the tools version that's it's going to use, instead of
the version of the client. This avoids unnecesarily triggering
upgrades at bootstrap time (fixing bug #1358078).
provider/manual: return hardware characteristics

StartInstance is updated to construct hardware
characteristics based on the node object returned
by MAAS in the result of "acquire".

We also fix StartInstance to use the architecture
of the acquired node to choose the appropriate
tools. We will acquire a node with an arbitrary
architecture unless specified, but we will now
guarantee correct tools.

Fixes https://bugs.launchpad.net/juju-core/+bug/1193998
Fixes https://bugs.launchpad.net/juju-core/+bug/1303853
provider/azure: custom data test needs to provide a real tools version

...now that MachineConfig.Tools is used to populate upgradedToVersion
in the initial agent.conf.
Merge pull request #535 from mjs/1358078-avoid-upgrade-with-bootstrap-upload-tools

environs/cloudinit: use actual tools version in bootstrap agent.conf

The upgradedToVersion field in the bootstrap machine agent's config will now match the tools version that's it's going to use, instead of the version of the client. This avoids unnecesarily triggering upgrades at bootstrap time (fixing bug #1358078).
state/apiserver/common: NewEnvironMachinesWatcher takes an authorizer

This PR removes the incorrect use of `canWatch("")`, replacing it with a call to the underlying authorizer as it is that authorizer which can tell if the authenticated entity is permitted to act as an Environment manager.

A similar change is coming for EnvironWatcher in a followup PR.