diff --git a/manifests/manage_app_pool.pp b/manifests/manage_app_pool.pp index bfffc38..3e7d9a3 100644 --- a/manifests/manage_app_pool.pp +++ b/manifests/manage_app_pool.pp @@ -9,40 +9,40 @@ if ($ensure in ['present','installed']) { exec { "Create-${app_pool_name}" : - command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; New-Item \"IIS:\\AppPools\\${app_pool_name}\"\"", + command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; New-Item \\\"IIS:\\AppPools\\${app_pool_name}\\\"\"", path => "${iis::param::powershell::path};${::path}", - onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\AppPools\\${app_pool_name}\")) { exit 1 } else {exit 0}\"", + onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\AppPools\\${app_pool_name}\\\")) { exit 1 } else {exit 0}\"", logoutput => true, } exec { "Framework-${app_pool_name}" : - command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" managedRuntimeVersion ${managed_runtime_version}\"", + command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\${app_pool_name}\\\" managedRuntimeVersion ${managed_runtime_version}\"", path => "${iis::param::powershell::path};${::path}", - onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" managedRuntimeVersion).Value.CompareTo('${managed_runtime_version}') -eq 0) { exit 1 } else { exit 0 }\"", + onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\${app_pool_name}\\\" managedRuntimeVersion).Value.CompareTo('${managed_runtime_version}') -eq 0) { exit 1 } else { exit 0 }\"", require => Exec["Create-${app_pool_name}"], logoutput => true, } exec { "32bit-${app_pool_name}" : - command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" enable32BitAppOnWin64 ${enable_32_bit}\"", + command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\${app_pool_name}\\\" enable32BitAppOnWin64 ${enable_32_bit}\"", path => "${iis::param::powershell::path};${::path}", - onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean('${enable_32_bit}')) { exit 1 } else { exit 0 }\"", + onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\${app_pool_name}\\\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean('${enable_32_bit}')) { exit 1 } else { exit 0 }\"", require => Exec["Create-${app_pool_name}"], logoutput => true, } exec { "ManagedPipelineMode-${app_pool_name}" : path => "${iis::param::powershell::path};${::path}", - command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" managedPipelineMode ${managed_pipeline_mode}\"", - onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" managedPipelineMode).Value.CompareTo('${managed_pipeline_mode}') -eq 0) { exit 1 } else { exit 0 }\"", + command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\${app_pool_name}\\\" managedPipelineMode ${managed_pipeline_mode}\"", + onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\${app_pool_name}\\\" managedPipelineMode).Value.CompareTo('${managed_pipeline_mode}') -eq 0) { exit 1 } else { exit 0 }\"", require => Exec["Create-${app_pool_name}"], logoutput => true, } } else { exec { "Delete-${app_pool_name}" : - command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Remove-Item \"IIS:\\AppPools\\${app_pool_name}\" -Recurse\"", + command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Remove-Item \\\"IIS:\\AppPools\\${app_pool_name}\\\" -Recurse\"", path => "${iis::param::powershell::path};${::path}", - onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if(!(Test-Path \"IIS:\\AppPools\\${app_pool_name}\")) { exit 1 } else {exit 0}\"", + onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if(!(Test-Path \\\"IIS:\\AppPools\\${app_pool_name}\\\")) { exit 1 } else {exit 0}\"", logoutput => true, } } diff --git a/manifests/manage_virtual_application.pp b/manifests/manage_virtual_application.pp index 1790da9..1f1ee6c 100644 --- a/manifests/manage_virtual_application.pp +++ b/manifests/manage_virtual_application.pp @@ -11,15 +11,15 @@ exec { "CreateVirtualApplication-${site_name}-${virtual_application_name}" : command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; New-WebApplication -Name ${virtual_application_name} -Site ${site_name} -PhysicalPath ${site_path} -ApplicationPool ${app_pool}\"", path => "${iis::param::powershell::path};${::path}", - onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\Sites\\${site_name}\\${virtual_application_name}\")) { exit 1 } else { exit 0 }\"", - require => [ iis::createpath["${site_name}-${virtual_application_name}-${site_path}"], iis::manage_site[$site_name] ], + onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\Sites\\${site_name}\\${virtual_application_name}\\\")) { exit 1 } else { exit 0 }\"", + require => [ Iis::Createpath["${site_name}-${virtual_application_name}-${site_path}"], Iis::Manage_site[$site_name] ], logoutput => true, } } else { exec { "DeleteVirtualApplication-${site_name}-${virtual_application_name}" : command => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Remove-WebApplication -Name ${virtual_application_name} -Site ${site_name}\"", path => "${iis::param::powershell::path};${::path}", - onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if(!(Test-Path \"IIS:\\Sites\\${site_name}\\${virtual_application_name}\")) { exit 1 } else { exit 0 }\"", + onlyif => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if(!(Test-Path \\\"IIS:\\Sites\\${site_name}\\${virtual_application_name}\\\")) { exit 1 } else { exit 0 }\"", logoutput => true, } } diff --git a/spec/defines/manage_app_pool_spec.rb b/spec/defines/manage_app_pool_spec.rb index 8681df2..8bc6fb3 100644 --- a/spec/defines/manage_app_pool_spec.rb +++ b/spec/defines/manage_app_pool_spec.rb @@ -10,19 +10,19 @@ it { should include_class('iis::param::powershell') } it { should contain_exec('Create-myAppPool.example.com').with( { - :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \"IIS:\\AppPools\\myAppPool.example.com\"\"", - :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\AppPools\\myAppPool.example.com\")) { exit 1 } else {exit 0}\"", + :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\"\"", + :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\AppPools\\myAppPool.example.com\\\")) { exit 1 } else {exit 0}\"", }) } it { should contain_exec('Framework-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion v4.0\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion v4.0\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} it { should contain_exec('32bit-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64 true\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'true\')) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64 true\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'true\')) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} end @@ -33,19 +33,19 @@ it { should include_class('iis::param::powershell') } it { should contain_exec('Create-myAppPool.example.com').with( { - :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \"IIS:\\AppPools\\myAppPool.example.com\"\"", - :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\AppPools\\myAppPool.example.com\")) { exit 1 } else {exit 0}\"", + :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\"\"", + :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\AppPools\\myAppPool.example.com\\\")) { exit 1 } else {exit 0}\"", }) } it { should contain_exec('Framework-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion v4.0\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion v4.0\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} it { should contain_exec('32bit-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64 false\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'false\')) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64 false\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'false\')) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} end @@ -90,19 +90,19 @@ let(:params) {{ :ensure => 'present' }} it { should contain_exec('Create-myAppPool.example.com').with( { - :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \"IIS:\\AppPools\\myAppPool.example.com\"\"", - :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\AppPools\\myAppPool.example.com\")) { exit 1 } else {exit 0}\"", + :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\"\"", + :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\AppPools\\myAppPool.example.com\\\")) { exit 1 } else {exit 0}\"", }) } it { should contain_exec('Framework-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion v4.0\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion v4.0\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} it { should contain_exec('32bit-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64 false\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'false\')) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64 false\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'false\')) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} end @@ -112,19 +112,19 @@ let(:params) {{ :ensure => 'installed' }} it { should contain_exec('Create-myAppPool.example.com').with( { - :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \"IIS:\\AppPools\\myAppPool.example.com\"\"", - :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\AppPools\\myAppPool.example.com\")) { exit 1 } else {exit 0}\"", + :command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\"\"", + :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\AppPools\\myAppPool.example.com\\\")) { exit 1 } else {exit 0}\"", }) } it { should contain_exec('Framework-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion v4.0\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion v4.0\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" managedRuntimeVersion).Value.CompareTo(\'v4.0\') -eq 0) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} it { should contain_exec('32bit-myAppPool.example.com').with({ - 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64 false\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\myAppPool.example.com\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'false\')) { exit 1 } else { exit 0 }\"", + 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64 false\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Get-ItemProperty \\\"IIS:\\AppPools\\myAppPool.example.com\\\" enable32BitAppOnWin64).Value -eq [System.Convert]::ToBoolean(\'false\')) { exit 1 } else { exit 0 }\"", 'require' => 'Exec[Create-myAppPool.example.com]', })} end @@ -134,8 +134,8 @@ let(:params) {{ :ensure => 'absent' }} it { should contain_exec('Delete-myAppPool.example.com').with( { - :command => "#{powershell} -Command \"Import-Module WebAdministration; Remove-Item \"IIS:\\AppPools\\myAppPool.example.com\" -Recurse\"", - :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \"IIS:\\AppPools\\myAppPool.example.com\")) { exit 1 } else {exit 0}\"", + :command => "#{powershell} -Command \"Import-Module WebAdministration; Remove-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\" -Recurse\"", + :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \\\"IIS:\\AppPools\\myAppPool.example.com\\\")) { exit 1 } else {exit 0}\"", }) } it { should_not contain_exec('Framework-myAppPool.example.com') } @@ -148,8 +148,8 @@ let(:params) {{ :ensure => 'purged' }} it { should contain_exec('Delete-myAppPool.example.com').with( { - :command => "#{powershell} -Command \"Import-Module WebAdministration; Remove-Item \"IIS:\\AppPools\\myAppPool.example.com\" -Recurse\"", - :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \"IIS:\\AppPools\\myAppPool.example.com\")) { exit 1 } else {exit 0}\"", + :command => "#{powershell} -Command \"Import-Module WebAdministration; Remove-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\" -Recurse\"", + :onlyif => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \\\"IIS:\\AppPools\\myAppPool.example.com\\\")) { exit 1 } else {exit 0}\"", }) } it { should_not contain_exec('Framework-myAppPool.example.com') } diff --git a/spec/defines/manage_virtual_application_spec.rb b/spec/defines/manage_virtual_application_spec.rb index 0bd9262..e8a8548 100644 --- a/spec/defines/manage_virtual_application_spec.rb +++ b/spec/defines/manage_virtual_application_spec.rb @@ -15,7 +15,7 @@ it { should contain_exec('CreateVirtualApplication-myWebSite-mySite').with({ 'command' => "#{powershell} -Command \"Import-Module WebAdministration; New-WebApplication -Name mySite -Site myWebSite -PhysicalPath C:\\inetpub\\wwwroot\\myHost -ApplicationPool myAppPool.example.com\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\Sites\\myWebSite\\mySite\")) { exit 1 } else { exit 0 }\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\Sites\\myWebSite\\mySite\\\")) { exit 1 } else { exit 0 }\"", })} end @@ -30,7 +30,7 @@ it { should contain_exec('CreateVirtualApplication-myWebSite-mySite').with({ 'command' => "#{powershell} -Command \"Import-Module WebAdministration; New-WebApplication -Name mySite -Site myWebSite -PhysicalPath C:\\inetpub\\wwwroot\\myHost -ApplicationPool myAppPool.example.com\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\Sites\\myWebSite\\mySite\")) { exit 1 } else { exit 0 }\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\Sites\\myWebSite\\mySite\\\")) { exit 1 } else { exit 0 }\"", })} end @@ -45,7 +45,7 @@ it { should contain_exec('CreateVirtualApplication-myWebSite-mySite').with({ 'command' => "#{powershell} -Command \"Import-Module WebAdministration; New-WebApplication -Name mySite -Site myWebSite -PhysicalPath C:\\inetpub\\wwwroot\\myHost -ApplicationPool myAppPool.example.com\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \"IIS:\\Sites\\myWebSite\\mySite\")) { exit 1 } else { exit 0 }\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if((Test-Path \\\"IIS:\\Sites\\myWebSite\\mySite\\\")) { exit 1 } else { exit 0 }\"", })} end @@ -60,7 +60,7 @@ it { should contain_exec('DeleteVirtualApplication-myWebSite-mySite').with({ 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Remove-WebApplication -Name mySite -Site myWebSite\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \"IIS:\\Sites\\myWebSite\\mySite\")) { exit 1 } else { exit 0 }\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \\\"IIS:\\Sites\\myWebSite\\mySite\\\")) { exit 1 } else { exit 0 }\"", })} end @@ -75,7 +75,7 @@ it { should contain_exec('DeleteVirtualApplication-myWebSite-mySite').with({ 'command' => "#{powershell} -Command \"Import-Module WebAdministration; Remove-WebApplication -Name mySite -Site myWebSite\"", - 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \"IIS:\\Sites\\myWebSite\\mySite\")) { exit 1 } else { exit 0 }\"", + 'onlyif' => "#{powershell} -Command \"Import-Module WebAdministration; if(!(Test-Path \\\"IIS:\\Sites\\myWebSite\\mySite\\\")) { exit 1 } else { exit 0 }\"", })} end end \ No newline at end of file