Sha256: cef6b60b6f5fe80f473ffcf94d95fde33bb99a2f19e080170f93ea8fb482c33f

Contents?: true

Size: 1.18 KB

Versions: 46

Compression:

Stored size: 1.18 KB

Contents

---
title: About the vbscript Resource
---

# vbscript

Use the `vbscript` InSpec audit resource to test a VBScript on the Windows platform.

## Syntax

A `vbscript` resource block tests the output of a VBScript on the Windows platform:

    describe vbscript('script contents') do
      its('stdout') { should eq 'output' }
    end

where

* `'script_name'` is the name of the VBScript to test
* `('output')` is the expected output of the VBScript


## Matchers

This InSpec audit resource has the following matchers:

### be

<%= partial "/shared/matcher_be" %>

### cmp

<%= partial "/shared/matcher_cmp" %>

### eq

<%= partial "/shared/matcher_eq" %>

### include

<%= partial "/shared/matcher_include" %>

### match

<%= partial "/shared/matcher_match" %>

## Examples

The following examples show how to use this InSpec audit resource.

### Test a VBScript

A VBScript file similar to:

    script = <<-EOH
      WScript.Echo "hello"
    EOH

may be tested for multiple lines:

    describe vbscript(script) do
      its('stdout') { should eq "hello\r\n" }
    end

and tested for whitespace removal from standard output:

    describe vbscript(script) do
      its('strip') { should eq "hello" }
    end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
inspec-1.40.0 docs/resources/vbscript.md.erb
inspec-1.39.1 docs/resources/vbscript.md.erb
inspec-1.38.8 docs/resources/vbscript.md.erb
inspec-1.37.6 docs/resources/vbscript.md.erb
inspec-1.36.1 docs/resources/vbscript.md.erb
inspec-1.35.1 docs/resources/vbscript.md.erb
inspec-1.34.1 docs/resources/vbscript.md.erb
inspec-1.33.12 docs/resources/vbscript.md.erb
inspec-1.33.1 docs/resources/vbscript.md.erb
inspec-1.32.1 docs/resources/vbscript.md.erb
inspec-1.31.1 docs/resources/vbscript.md.erb
inspec-1.31.0 docs/resources/vbscript.md.erb
inspec-1.30.0 docs/resources/vbscript.md.erb
inspec-1.29.0 docs/resources/vbscript.md.erb
inspec-1.28.1 docs/resources/vbscript.md.erb
inspec-1.28.0 docs/resources/vbscript.md.erb
inspec-1.27.0 docs/resources/vbscript.md.erb
inspec-1.26.0 docs/resources/vbscript.md.erb
inspec-1.25.1 docs/resources/vbscript.md.erb
inspec-1.25.0 docs/resources/vbscript.md.erb