Hi All,
I am trying to install an application using PowerShell. It works fine when I run it from powershell.
But when I try to use same script inside powershell_script recource in chef recipe it behaves differently. It is not showing the progress of the installation until the process is completed.
Here is the resource usage:
powershell_script 'install-arcserve-udp' do
guard_interpreter :powershell_script
code <<-EOH
Write-Host 'Installation summary log will be stored under "#{node['arcserve_udp']['summary_file']}"'
$InstallerArguments = '-s -a -q -Https:1 -Products:All -User:"Administrator" -Password:"****" -SummaryPath:"#{node['arcserve_udp']['summary_file']}"'
$process = Start-Process -FilePath "#{node['arcserve_udp']['installer_file']}" -ArgumentList $InstallerArguments -WindowStyle Hidden -PassThru
Write-Host "ArcServe UDP installer is running"
# wait for the process to complete, and meanwhile display some dots to indicate progress:
do
{
Write-Host '.' -NoNewline
Start-Sleep 10
} until ($process.HasExited)
Write-Host
EOH
action :run
end
When I run this recipe during bootstrapping new server, it just says
powershell_script[install-arcserve-udp] ran successfully
and comes out of the recource block insantly without displaying anything until the process is completed. Please help
Thanks