mixlibrary-core 0.0.13-x86-mingw32 → 0.0.14-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fc58ba93bad38a10b866639acd4dec520dc8b2e
4
- data.tar.gz: bde11223d3908a78523b0aa55334d5a26df9afe3
3
+ metadata.gz: 31d9be32be42fbd8e515395d2f3c59ec88aa5189
4
+ data.tar.gz: 216442cf8a7e98891b1e41d6c33db4c05c0e55eb
5
5
  SHA512:
6
- metadata.gz: de035dc881ebd47499746738eb6ad397ea0d83f527b0f7464b016b1a36bb560cf6079868c2ee6c26f9ffbc75e2134e16c18b7eebaff15a32d850ddf1c2ee01c9
7
- data.tar.gz: 7f9b39c4d2aeeedee4be8675190199105e99c5d3924a48f65c8dc5bfe8baebca18274d7ba16e2fec54edd892741e96004a2a804fefcf03245fd4b8859e7af896
6
+ metadata.gz: 5dc1dfb1a1ec123fa2e96d93e394a6a0551af7eeb5e9d14156f277381e74460e3bad9bca1e36b0928dbdfa4e82e08fa401fb5fdef43f58ea9a006435a6618cbd
7
+ data.tar.gz: 28d0708743a4bf993c08a80d5532921edb1d81130ca5fcb792503392598835586ee758bc17e43fca1d74203751512cc3a2c9a71c9a0bf9d75261a668e3c6d9d5
@@ -1,6 +1,6 @@
1
1
  module Mixlibrary
2
2
  module Core
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  NAME = "mixlibrary-core"
5
5
  end
6
6
  end
@@ -15,17 +15,6 @@ module Mixlibrary
15
15
  @feature_name=feature_name
16
16
  end
17
17
 
18
- def install_feature()
19
- Chef::Log.info("Installing feature:#{@feature_name}")
20
- script= <<-EOF
21
- import-module ServerManager;
22
- Add-WindowsFeature -Name "#{@feature_name}"
23
- EOF
24
-
25
- procobj = Mixlibrary::Core::Shell.windows_script_out!(:powershell, script)
26
- Chef::Log.debug("Command output: #{procobj.stdout}")
27
- end
28
-
29
18
  def remove_feature()
30
19
  Chef::Log.info("Removing feature:#{@feature_name}")
31
20
  script= <<-EOF
@@ -52,13 +41,26 @@ module Mixlibrary
52
41
  Chef::Log.info("Is feature available:#{@feature_name}")
53
42
  script= <<-EOF
54
43
  import-module ServerManager;
55
- Get-WindowsFeature -Name #{@feature_name}
44
+ $myvar=@(get-WindowsFeature -Name #{@feature_name})
45
+
46
+ if($myvar.Count -eq 0){
47
+ write-host "Found no matching features"
48
+ exit 6
49
+ }
50
+
51
+ write-host "Printing Matching Features"
52
+ foreach($myfeature in $myvar){
53
+ $myfeature | ft -Property FeatureType,DisplayName,Name,InstallState,Installed | Out-Host
54
+ }
55
+
56
+ exit 5
57
+
56
58
  EOF
57
59
 
58
- procobj = Mixlibrary::Core::Shell.windows_script_out!(:powershell, script)
60
+ procobj = Mixlibrary::Core::Shell.windows_script_out(:powershell, script)
59
61
  Chef::Log.info("Command output:#{procobj.stdout}")
60
62
 
61
- return procobj.stderr.empty? && procobj.stdout !~ /Removed/i
63
+ return procobj.stderr.empty? && procobj.stdout !~ /Removed/i && procobj.exitstatus==5
62
64
  end
63
65
 
64
66
  def is_installed?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlibrary-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Nicholas Carpenter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler