Method: Inspec::Resources::VBScript#initialize
- Defined in:
- lib/resources/vbscript.rb
#initialize(vbscript) ⇒ VBScript
Returns a new instance of VBScript.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/resources/vbscript.rb', line 37 def initialize(vbscript) return skip_resource 'The `vbscript` resource is not supported on your OS yet.' unless inspec.os.windows? @seperator = SecureRandom.uuid cmd = " $vbscript = @\"\n \#{vbscript}\n Wscript.Stdout.Write \"\#{@seperator}\"\n \"@\n $filename = [System.IO.Path]::GetTempFileName() + \".vbs\"\n New-Item $filename -type file -force -value $vbscript | Out-Null\n cscript.exe /nologo $filename\n Remove-Item $filename | Out-Null\n EOH\n super(cmd)\nend\n" |