class Inspec::Resources::VBScript
@see msdn.microsoft.com/en-us/library/aa364991.aspx<br>after we executed it
Since Windows does not delete tmp files automatically, we remove the VBScript
version information.
We run cscript with /nologo option to get the expected output only with the
encodedCommand since train does not allow file upload yet.
embedded in Powershell to ease the file transfer and reuse powershell
For that reason, we call csript.exe directy with the script. Vbscript is
$script.ExecuteStatement($Cmd)
$script.language = “vbscript”
$script = new-object -comobject MSScriptControl.ScriptControl
not to use scriptcontrol, due to the fact that it works on 32 bit systems only:
This resource allows users to run vbscript on windows machines. We decided
def initialize(vbscript)
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 cript = @" script} ipt.Stdout.Write "#{@seperator}" ename = [System.IO.Path]::GetTempFileName() + ".vbs" Item $filename -type file -force -value $vbscript | Out-Null ipt.exe /nologo $filename ve-Item $filename | Out-Null super(cmd) end
def parse_stdout
def parse_stdout res = inspec.backend.run_command(@command) parsed_result = res.stdout.gsub(/#{@seperator}\r\n$/, '') res.stdout = parsed_result res end
def result
def result @result ||= parse_stdout end
def to_s
def to_s 'Windows VBScript' end