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 = <<~EOH $vbscript = @" #{vbscript} Wscript.Stdout.Write "#{@seperator}" "@ $filename = [System.IO.Path]::GetTempFileName() + ".vbs" New-Item $filename -type file -force -value $vbscript | Out-Null cscript.exe /nologo $filename Remove-Item $filename | Out-Null EOH super(cmd) end |