0

There are lots of build-in resources in Serverspec, but I want to extend it to my own needs. In InSpec it support script resource which will run the PowerShell script and get the result it seems.

But InSpec is too slow. Is there any equivalent to script resource in Serverspec exists? It is running PowerShell script in the backend for each resource. How to write my own PowerShell script and call it via Serverspec?

techraf
  • 64,883
  • 27
  • 193
  • 198
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
  • You mean a new resource? You can write your own RSpec matcher for that if you want, but you would also need to write the Windows backend command for it too. If you mean just executing a script, you can do it with the `command` resource. Can you give an example of what you want to do? – Matthew Schuchard Aug 16 '16 at 11:54
  • @MattSchuchard I am very good at powershell scripting . I can write the backend powershell script. But what i don't know is how to make that available to serverspec. (as i am new to ruby). I want to check sql database table entries, web.config file entries etc. I can write powershell for that. But i want it to be integrated with rspec so that one script to execute all the tests. – Samselvaprabu Aug 16 '16 at 12:15
  • Are you executing your tests remotely or locally? – Matthew Schuchard Aug 16 '16 at 13:10
  • @MattSchuchard I am executing locally – Samselvaprabu Aug 16 '16 at 13:27
  • Does using a `command` resource to execute the powershell script not work for you? – Matthew Schuchard Aug 16 '16 at 14:44

0 Answers0