2016-09-22 14:43:57 +02:00
---
title: About the oneget Resource
2018-02-15 18:28:15 -06:00
platform: windows
2016-09-22 14:43:57 +02:00
---
# 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.
2017-10-03 14:35:10 -07:00
<br>
2016-09-27 12:03:23 -07:00
## Syntax
2016-09-22 14:43:57 +02:00
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
2017-10-03 14:35:10 -07:00
<br>
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
## Examples
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
The following examples show how to use this InSpec audit resource.
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
### Test if VLC is installed
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
describe oneget('VLC') do
it { should be_installed }
end
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
<br>
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
## Matchers
2016-09-22 14:43:57 +02:00
2018-02-15 19:07:18 -08:00
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
### be_installed
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
The `be_installed` matcher tests if the named package is installed on the system:
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
it { should be_installed }
2016-09-22 14:43:57 +02:00
2016-09-27 12:03:23 -07:00
### version
2016-09-22 14:43:57 +02:00
The `version` matcher tests if the named package version is on the system:
its('version') { should eq '1.2.3' }