Adding $ErrorActionPreference = "Stop" to get correct execution path
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/ac278886 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/ac278886 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/ac278886 Branch: refs/heads/master Commit: ac278886526df11b88bb8a8efd2105fa95a29f4d Parents: b23295c Author: Yavor Yanchev <[email protected]> Authored: Fri Oct 9 11:16:00 2015 +0300 Committer: Yavor Yanchev <[email protected]> Committed: Fri Oct 9 11:16:00 2015 +0300 ---------------------------------------------------------------------- .../apache/brooklyn/entity/nosql/mongodb/win/configure_mongodb.ps1 | 2 ++ .../apache/brooklyn/entity/nosql/mongodb/win/install_mongodb.ps1 | 2 ++ .../apache/brooklyn/entity/nosql/mongodb/win/launch_mongodb.ps1 | 2 ++ .../org/apache/brooklyn/entity/nosql/mongodb/win/stop_mongodb.ps1 | 2 ++ 4 files changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ac278886/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/configure_mongodb.ps1 ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/configure_mongodb.ps1 b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/configure_mongodb.ps1 index 06502b5..30bb908 100644 --- a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/configure_mongodb.ps1 +++ b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/configure_mongodb.ps1 @@ -21,6 +21,8 @@ #netsh advfirewall firewall add rule name=MongoDB dir=in protocol=tcp action=allow localport=27017 remoteip=any profile=any #( Get-WmiObject -Namespace "root\Microsoft\SqlServer\ComputerManagement11" -Query "Select * from ServerNetworkProtocolProperty where ProtocolName='Tcp' and IPAddressName='IPAll' and PropertyName='TcpPort'" ).SetStringValue("27017") +$ErrorActionPreference = "Stop" + New-Item c:\data\db -type directory -force New-Item c:\data\log -type directory -force http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ac278886/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/install_mongodb.ps1 ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/install_mongodb.ps1 b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/install_mongodb.ps1 index cc26200..cadcda8 100644 --- a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/install_mongodb.ps1 +++ b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/install_mongodb.ps1 @@ -19,6 +19,8 @@ # under the License. # +$ErrorActionPreference = "Stop" + $Path = "C:\InstallTemp" New-Item -ItemType Directory -Force -Path $Path http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ac278886/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/launch_mongodb.ps1 ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/launch_mongodb.ps1 b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/launch_mongodb.ps1 index 62d1bc4..bfc2e52 100644 --- a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/launch_mongodb.ps1 +++ b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/launch_mongodb.ps1 @@ -19,6 +19,8 @@ # under the License. # +$ErrorActionPreference = "Stop" + $serviceName = "MongoDB${config['mongodb.instance.name']}" Start-Service $serviceName http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ac278886/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/stop_mongodb.ps1 ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/stop_mongodb.ps1 b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/stop_mongodb.ps1 index 3343f76..fd8393d 100644 --- a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/stop_mongodb.ps1 +++ b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/mongodb/win/stop_mongodb.ps1 @@ -19,6 +19,8 @@ # under the License. # +$ErrorActionPreference = "Stop" + $serviceName = "MongoDB${config['mongodb.instance.name']}" Stop-Service $serviceName
