- Project State: Maintained
For more information on project states and SLAs, see this documentation.
This InSpec resource pack uses the ruby-pwsh provides the required resources to write tests for profiles using Pwsh.
This resource pack requires the use of train-pwsh
, which is a transport that is used to connect to a persistent powershell session. Please refer to the documentation of train-pwsh to ensure the environment variables have been set there for this work.
Since this is an InSpec resource pack, it only defines InSpec resources. To use these resources in your controls, create your profile:
inspec init profile my-profile
The above command generates a sample inspec.yml that depends on master
. We recommend this is pinned to a release of the resource pack as follows.
Example inspec.yml
:
name: my-profile
title: My own Pwsh profile
version: 0.1.0
inspec_version: '>= 4.6.9'
depends:
- name: inspec-pwsh
url: https://github.com/mitre/inspec-pwsh
(For available inspec-pwsh versions, see this list of inspec-pwsh versions.)
If a resource is in local, change the url
to path
.
name: my-profile
title: My own Pwsh profile
version: 0.1.0
inspec_version: '>= 4.6.9'
depends:
- name: inspec-pwsh
path: ../my-profile
(For available inspec-pwsh versions, see this list of inspec-pwsh versions.)
Add some tests and run the profile via:
inspec exec my-profile -t pwsh://pwsh-options
This resource pack allows the testing of the following Pwsh resources. If a resource you wish to test is not listed, please feel free to open an Issue. As an open-source project, we also welcome public contributions via Pull Request.
InSpec Supported Resources https://docs.chef.io/inspec/resources/
The InSpec Pwsh resources are community-supported. For bugs and features, please open a GitHub issue and label it appropriately.