diff options
author | John McCrae <john.mccrae@progress.com> | 2022-06-13 17:14:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-13 17:14:25 -0700 |
commit | b67e64c294ebd252c852d9f96782606bd0ad059b (patch) | |
tree | a77bc53df853387541e5304ce37927777064a263 | |
parent | dc5d1a612aef0c19ae5649408cf13b1ad5311bc3 (diff) | |
parent | f7fe7366744e74f5aeec50fb7281cdafe36c063c (diff) | |
download | chef-b67e64c294ebd252c852d9f96782606bd0ad059b.tar.gz |
Merge pull request #12988 from chef/jfm/update_cert_creation_on_PS3
-rw-r--r-- | spec/integration/client/client_spec.rb | 6 |
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 |