summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-06-09 07:57:04 -0700
committerJohn McCrae <john.mccrae@progress.com>2022-06-13 14:53:29 -0700
commitf7fe7366744e74f5aeec50fb7281cdafe36c063c (patch)
treea77bc53df853387541e5304ce37927777064a263
parentdc5d1a612aef0c19ae5649408cf13b1ad5311bc3 (diff)
downloadchef-f7fe7366744e74f5aeec50fb7281cdafe36c063c.tar.gz
refactoring the version check
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r--spec/integration/client/client_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 706dbe73c7..d2b79edf05 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -38,11 +38,11 @@ describe "chef-client" do
def install_certificate_in_store(client_name)
if ChefUtils.windows?
powershell_exec! <<~EOH
- if ($PSVersionTable.PSVersion -match 3) {
- New-SelfSignedCertificate -CertStoreLocation Cert:\\LocalMachine\\My -DnsName #{client_name}
+ if (-not ($PSVersionTable.PSVersion.Major -ge 5)) {
+ New-SelfSignedCertificate -CertStoreLocation Cert:\\LocalMachine\\My -DnsName "#{client_name}"
}
else {
- New-SelfSignedCertificate -certstorelocation cert:\\localmachine\\my -Subject #{client_name} -FriendlyName #{client_name} -KeyExportPolicy Exportable
+ New-SelfSignedCertificate -CertStoreLocation Cert:\\LocalMachine\\My -Subject "#{client_name}" -FriendlyName "#{client_name}" -KeyExportPolicy Exportable
}
EOH
end