mirror of
https://github.com/inspec/inspec
synced 2024-11-10 23:24:18 +00:00
iis_app_pool: Fix PowerShell JSON parsing error
This works around a current bug in PowerShell where the output cannot be parsed as JSON. The `-Compress` flag does not affect the validity of the data but only the appearance of the string. Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This commit is contained in:
parent
55ab0ead32
commit
66a343555b
2 changed files with 2 additions and 2 deletions
|
@ -89,7 +89,7 @@ class IisAppPool < Inspec.resource(1)
|
|||
script = <<~EOH
|
||||
Import-Module WebAdministration
|
||||
If (Test-Path '#{@pool_path}') {
|
||||
Get-Item '#{@pool_path}' | Select-Object * | ConvertTo-Json
|
||||
Get-Item '#{@pool_path}' | Select-Object * | ConvertTo-Json -Compress
|
||||
} Else {
|
||||
Write-Host '{}'
|
||||
}
|
||||
|
|
|
@ -528,7 +528,7 @@ class MockLoader
|
|||
"curl -H 'Content-Type: application/json' -u es_admin:password http://localhost:9200/_nodes" => cmd.call('elasticsearch-cluster-auth'),
|
||||
"curl -H 'Content-Type: application/json' http://elasticsearch.mycompany.biz:1234/_nodes" => cmd.call('elasticsearch-cluster-url'),
|
||||
# iis_app_pool resource
|
||||
"Import-Module WebAdministration\nIf (Test-Path 'IIS:\\AppPools\\DefaultAppPool') {\n Get-Item 'IIS:\\AppPools\\DefaultAppPool' | Select-Object * | ConvertTo-Json\n} Else {\n Write-Host '{}'\n}\n" => cmd.call('iis-default-app-pool'),
|
||||
"Import-Module WebAdministration\nIf (Test-Path 'IIS:\\AppPools\\DefaultAppPool') {\n Get-Item 'IIS:\\AppPools\\DefaultAppPool' | Select-Object * | ConvertTo-Json -Compress\n} Else {\n Write-Host '{}'\n}\n" => cmd.call('iis-default-app-pool'),
|
||||
|
||||
# iis_site resource
|
||||
"Get-Website 'Default Web Site' | Select-Object -Property Name,State,PhysicalPath,bindings,ApplicationPool | ConvertTo-Json" => cmd.call('iis-default-web-site'),
|
||||
|
|
Loading…
Reference in a new issue