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 +4 -4
- data/lib/mixlibrary/core/version.rb +1 -1
- data/lib/mixlibrary/core/windows/features.rb +16 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c10a24eb3f50ce2405ddcf5740ab1b4b896c3e91
|
4
|
+
data.tar.gz: 216442cf8a7e98891b1e41d6c33db4c05c0e55eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 373a39c2ab5fbb4e73771716f2afda39c60fe7d198bb8963799d3bfb56d69b475cb83b0f7eda5feb8c003c9b03725aa1d5a2377046781d52d76e49439774a8fb
|
7
|
+
data.tar.gz: 28d0708743a4bf993c08a80d5532921edb1d81130ca5fcb792503392598835586ee758bc17e43fca1d74203751512cc3a2c9a71c9a0bf9d75261a668e3c6d9d5
|
@@ -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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|