mixlibrary-core 0.0.13 → 0.0.14

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: ef4a566c667287778808f57fffce0bb5a57f754d
4
- data.tar.gz: 873869ec7de6d902d8110bd221a83d3f7c1c8438
3
+ metadata.gz: c10a24eb3f50ce2405ddcf5740ab1b4b896c3e91
4
+ data.tar.gz: 216442cf8a7e98891b1e41d6c33db4c05c0e55eb
5
5
  SHA512:
6
- metadata.gz: ec1f03b9858fb2e45b413a49c6a92a03f2ceb482bdce59222560f82fdd65827d3ff331e15da9e4cdd36ed9f044d0169bb102277814412dfa3c6cd704ae309888
7
- data.tar.gz: 8e94b5c2e35b9177954d93b6f646130ee468f2a325e2e9fa08967f561ef484cc97dce1ebe6be42d52a8d69836f66838c11aba4786654b4858ed4417b62d4dafa
6
+ metadata.gz: 373a39c2ab5fbb4e73771716f2afda39c60fe7d198bb8963799d3bfb56d69b475cb83b0f7eda5feb8c003c9b03725aa1d5a2377046781d52d76e49439774a8fb
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: ruby
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