when executing Powershell Script from Ruby "Can't convert true into String" error
- by Ozie Harb
I am trying to execute a powershell script from Ruby, I have entered the below command:
scriptPath = system('powershell \"C:\\Scripts\\DB_Setup.ps1\"')
The ruby Script is handling exceptions when an error is raised to stop the script as below command:
rescue => ex
message = "\nscript on server '#{`hostname`.strip()}' terminated unexpectedly:\n\nMessage: '#{ex.message}"
raise ex
Output Error:
script on server 'TestDB1' terminated unexpectedly:
Message: 'can't convert true into String'
Thanks