mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
Fix escaping of Windows package names
This commit is contained in:
commit
353ea9166e
2 changed files with 2 additions and 2 deletions
|
@ -314,7 +314,7 @@ module Inspec::Resources
|
|||
# Find the package
|
||||
cmd = inspec.command <<-EOF.gsub(/^\s*/, "")
|
||||
Get-ItemProperty (@("#{search_paths.join('", "')}") | Where-Object { Test-Path $_ }) |
|
||||
Where-Object { $_.DisplayName -match "^\s*#{package_name.shellescape}\.*" -or $_.PSChildName -match "^\s*#{package_name.shellescape}\.*" } |
|
||||
Where-Object { $_.DisplayName -like "#{package_name}" -or $_.PSChildName -like "#{package_name}" } |
|
||||
Select-Object -Property DisplayName,DisplayVersion | ConvertTo-Json
|
||||
EOF
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ class MockLoader
|
|||
"rmsock f0000000000000001 tcpcb" => cmd.call("rmsock-f0001"),
|
||||
"rmsock f0000000000000002 tcpcb" => cmd.call("rmsock-f0002"),
|
||||
# packages on windows
|
||||
"f7718ece69188bb19cd458e2aeab0a8d968f3d40ac2f4199e21cc976f8db5ef6" => cmd.call("get-item-property-package"),
|
||||
"6785190b3df7291a7622b0b75b0217a9a78bd04690bc978df51ae17ec852a282" => cmd.call("get-item-property-package"),
|
||||
# service status upstart on ubuntu
|
||||
"initctl status ssh" => cmd.call("initctl-status-ssh"),
|
||||
# upstart version on ubuntu
|
||||
|
|
Loading…
Add table
Reference in a new issue