{"id":22369817,"url":"https://github.com/equelin/ansible-win_pester","last_synced_at":"2026-04-29T16:05:49.368Z","repository":{"id":90375808,"uuid":"116267474","full_name":"equelin/ansible-win_pester","owner":"equelin","description":"Run Pester test with Ansible","archived":false,"fork":false,"pushed_at":"2018-01-04T17:01:19.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T08:46:20.448Z","etag":null,"topics":["ansible","pester","windows"],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/equelin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-04T14:12:03.000Z","updated_at":"2021-05-16T04:28:58.000Z","dependencies_parsed_at":"2023-04-02T12:07:22.375Z","dependency_job_id":null,"html_url":"https://github.com/equelin/ansible-win_pester","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/equelin/ansible-win_pester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equelin%2Fansible-win_pester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equelin%2Fansible-win_pester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equelin%2Fansible-win_pester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equelin%2Fansible-win_pester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/equelin","download_url":"https://codeload.github.com/equelin/ansible-win_pester/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equelin%2Fansible-win_pester/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268554909,"owners_count":24269062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","pester","windows"],"created_at":"2024-12-04T19:28:42.151Z","updated_at":"2025-10-14T06:05:57.440Z","avatar_url":"https://github.com/equelin.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-win_pester\n\n\u003e This module is under developpement. Tested with ANsible 2.4 and Windows Server 2016. Please open issues or submit PR.\n\nRun [Pester](https://github.com/pester/Pester) tests with Ansible on Windows hosts.\n\nYou may integrate this module in your Ansible workflow to check if the configuration of your Windows host is correct after running your playbook. \n\n## Requirements\n\n- The Pester module has to be available on the remote host.\n- The test files have to be availaible on the remote host. You can use the `win_copy` module to copy the test files.\n\n## Instructions\n\nCopy the files `win_pester.ps1` and `win_pester.py` into a folder available in your Ansible module path.\n\nAlternatively you can store the files in a folder named `library` alongside your playbook.\n\n## Options\n\n| parameter | required | default | choices | comments |\n| --- | --- | --- | --- | --- |\n| src | true | | | (string) Specifies the source path of the test files on the remote host. Could be files or folder. If a folder, the module will try to run Pester tests with all ps1 files available in it.|\n| version | false | | | (string) Specifies the minimum version of the Pester module that has to be available on the remote host. |\n\n## Examples\n\n```yaml\n- name: Run Pester test(s) in the file C:\\Pester\\test01.test.ps1\n  win_pester:\n    src: C:\\Pester\\test01.test.ps1\n\n- name: Run Pester test(s) located in the 'C:\\Pester' folder and defining the minimum version of the pester module\n  win_pester:\n    src: C:\\Pester\n    version: '3.4.0'\n```\n\n## Return Values\n\n| name | description | returned | type | sample |\n| --- | --- | --- | --- | --- |\n| pester_result | Data returned by the Pester module | success |  |   |\n| pester_version | Version of the Pester module find on the remote host | | string | '4.1.0' |\n\n## Playbook\n\nThis playbook will copy the Pester tests files on the remote hosts, run the tests and verified if a test failed. The tests files are deleted at the end.\n\n```yaml\n- name: Test out win_pester module\n  hosts: windows\n  vars:\n    local_test_files:\n      - \"files/test01.test.ps1\"\n      - \"files/test02.test.ps1\"\n    remote_test_folder: C:\\Pester\\\n\n  tasks:\n    - name : Copy test file(s)\n      win_copy:\n        src: \"{{ item }}\"\n        dest: \"{{ remote_test_folder }}\"\n      with_items: \"{{local_test_files}}\"\n\n    - name: Run Pester test(s) located in a folder and defining the minimum version of the pester module\n      win_pester:\n        src: \"{{ remote_test_folder }}\"\n        version: '3.4.0'\n      register: result\n\n    - name: Check if one of the Pester tests failed\n      assert:\n        that: result.pester_result.FailedCount == 0\n\n    - name: Delete test folder\n      win_file:\n        path: \"{{ remote_test_folder }}\"\n        state: absent\n```\n\n## Developpement\n\nFeel free to open issues and submit PR.\n\nIf you want to run integration tests, you can look at the Ansible role in `./test/integration/targets/win_pester`\n\n## Author\n\n**Erwan Quélin**\n- \u003chttps://github.com/equelin\u003e\n- \u003chttps://twitter.com/erwanquelin\u003e\n\n## License\n\nGNU General Public License v3.0\n\nSee [LICENSE](LICENSE) to see the full text.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequelin%2Fansible-win_pester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fequelin%2Fansible-win_pester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequelin%2Fansible-win_pester/lists"}