Sha256: 0f1f06f2d47dfba6c48c9b6d385693a83dd9bf826004d8ad5639cae4b66c6bb2

Contents?: true

Size: 1.34 KB

Versions: 5

Compression:

Stored size: 1.34 KB

Contents

---
title: About the oneget Resource
platform: windows
---

# oneget

Use the `oneget` InSpec audit resource to test if the named package and/or package version is installed on the system. This resource uses Oneget, which is `part of the Windows Management Framework 5.0 and Windows 10 <https://github.com/OneGet/oneget>`__. This resource uses the `Get-Package` cmdlet to return all of the package names in the Oneget repository.

<br>

## Syntax

A `oneget` resource block declares a package and (optionally) a package version:

    describe oneget('name') do
      it { should be_installed }
    end

where

* `('name')` must specify the name of a package, such as `'VLC'`
* `be_installed` is a valid matcher for this resource

<br>

## Examples

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

### Test if VLC is installed

    describe oneget('VLC') do
      it { should be_installed }
    end

<br>

## Matchers

For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).

### be_installed

The `be_installed` matcher tests if the named package is installed on the system:

    it { should be_installed }

### version

The `version` matcher tests if the named package version is on the system:

    its('version') { should eq '1.2.3' }

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inspec-2.1.81 docs/resources/oneget.md.erb
inspec-2.1.21 docs/resources/oneget.md.erb
inspec-2.1.10 docs/resources/oneget.md.erb
inspec-2.0.32 docs/resources/oneget.md.erb
inspec-2.0.17 docs/resources/oneget.md.erb