mixlibrary-core 0.0.13-x86-mingw32 → 0.0.14-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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: 31d9be32be42fbd8e515395d2f3c59ec88aa5189
|
4
|
+
data.tar.gz: 216442cf8a7e98891b1e41d6c33db4c05c0e55eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dc1dfb1a1ec123fa2e96d93e394a6a0551af7eeb5e9d14156f277381e74460e3bad9bca1e36b0928dbdfa4e82e08fa401fb5fdef43f58ea9a006435a6618cbd
|
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: x86-mingw32
|
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
|