{"id":19186542,"url":"https://github.com/dexterposh/psremotely","last_synced_at":"2025-05-08T01:20:34.199Z","repository":{"id":76137857,"uuid":"66343973","full_name":"DexterPOSH/PSRemotely","owner":"DexterPOSH","description":"Remote operations validation framework, exposes a DSL to wrap existing Pester/PoshSpec based validation tests.","archived":false,"fork":false,"pushed_at":"2019-10-02T06:15:18.000Z","size":402,"stargazers_count":46,"open_issues_count":12,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-20T05:32:20.879Z","etag":null,"topics":["operations","opsvalidation","pester","powershell","remoteopsvalidation","validation-engine"],"latest_commit_sha":null,"homepage":"http://psremotely.readthedocs.io/en/latest/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DexterPOSH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","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,"zenodo":null}},"created_at":"2016-08-23T07:27:30.000Z","updated_at":"2023-03-30T17:33:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"5380c93c-e7ad-4c2c-80fe-fca70ec0a561","html_url":"https://github.com/DexterPOSH/PSRemotely","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterPOSH%2FPSRemotely","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterPOSH%2FPSRemotely/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterPOSH%2FPSRemotely/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterPOSH%2FPSRemotely/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DexterPOSH","download_url":"https://codeload.github.com/DexterPOSH/PSRemotely/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252979332,"owners_count":21835033,"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","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":["operations","opsvalidation","pester","powershell","remoteopsvalidation","validation-engine"],"created_at":"2024-11-09T11:15:27.730Z","updated_at":"2025-05-08T01:20:34.191Z","avatar_url":"https://github.com/DexterPOSH.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/w22ytbuyjr7a10ia/branch/master?svg=true)](https://ci.appveyor.com/project/DexterPOSH/psremotely/branch/master) [![Documentation Status](https://readthedocs.org/projects/psremotely/badge/?version=latest)](http://psremotely.readthedocs.io/en/latest/)\n[![GitPitch](https://gitpitch.com/assets/badge.svg)](https://gitpitch.com/dexterposh/PSRemotely/master?grs=github\u0026t=white)\n\n![alt](PSRemotely.png)\n============\n\nPSRemotely, started as a fork of the [Remotely project](https://github.com/PowerShell/Remotely) and over the time grew out of it.\nIn a nutshell it let's you execute Pester tests against a remote machine. PSRemotely can use PoshSpec style infrastucture validation tests too.\n\nNote - In the code \u0026 documentation the term 'Remotely' and 'PSRemotely' refer to the same.\n\nIt supports copying of the modules and artifacts to the remote node before the Pester tests are run. \n\nDescription\n======================\nPSRemotely exposes a DSL which makes it easy to run Pester tests on the remote nodes.\nIf you already have pester tests then you need to just wrap them inside the PSRemotely keyword and specify the node information using the Node keyword.\n\nPSRemotely workflow is as under :\n\n1. Read PSRemotely.json file to determine the path \u0026 modules to be used on the remote nodes.\n2. Bootstrap the remote nodes, this involves \n    - Testing the remote node path exists.\n    - All the modules required are copied from the Lib/ folder to the remote node.\n3. Drop the Pester tests (Describe blocks) as individual tests file on the remote node. \n    Also copy the items defined in the PSRemotely.json, which are placed under Artifacts/ folder inside local PSRemotely folder.\n4. Invoke the tests using background jobs on the remote nodes and wait for these jobs to complete, finally process and output a JSON object back.\n5. It also exports a global variable named $PSRemotely to which the Node bootstrap map and PSSession information is stored.\n\n## Remote Ops validation\n\nWell this is a term coined by us for some of the infrastucture validation being done for Engineered solutions.\nSo taking liberty to use this here. \n\nSuppose, you already have below Pester test for some nodes in our environment:\n\n```powershell\nDescribe 'Bits Service test' {\n    \n    $BitsService = Get-Service -Name Bits\n    \n    It \"Should have a service named bits\" {\n        $BitsService | Should Not BeNullOrEmpty\n    }\n    \n    it 'Should be running' {\n        $BitsService.Status | Should be 'Running'\n    }\n}\n```\nIf you want to target the very same tests on the remote node named say AD,WDS \u0026 DHCP from your current workstation (part of the same domain), you can use PSRemotely.\n\n\nUsage with PSRemotely:\n\n```powershell\nPSRemotely {\n\t\n    Node AD, WDS, DHCP {\n\t\t\n        Describe 'Bits Service test' {\n\t\t\n            $BitsService = Get-Service -Name Bits\n            \n            It \"Should have a service named bits\" {\n                $BitsService | Should Not BeNullOrEmpty\n            }\n            \n            It 'Should be running' {\n                $BitsService.Status | Should be 'Running'\n            }\n        }\t\t\n\t}\n}\n```\nOnce you have the tests file ready , save it with a \u003cFileName\u003e.PSRemotely.ps1 extension, below is how you invoke the PSRemotely framework to start the remote ops validation : \n\n```powershell\nInvoke-PSRemotely -Script \u003cFileName\u003e.PSRemotely.ps1\n```\n\nOutput of the above is a JSON object, if the tests pass then an empty JSON object array of *TestResult* is returned \notherwise the Error record thrown by Pester is returned :\n\n```json\n{\n    \"Status\":  true,\n    \"NodeName\":  \"WDS\",\n    \"Tests\":  [\n                  {\n                      \"TestResult\":  [\n\n                                     ],\n                      \"Result\":  true,\n                      \"Name\":  \"Bits Service test\"\n                  }\n              ]\n}\n{\n    \"Status\":  true,\n    \"NodeName\":  \"AD\",\n    \"Tests\":  [\n                  {\n                      \"TestResult\":  [\n\n                                     ],\n                      \"Result\":  true,\n                      \"Name\":  \"Bits Service test\"\n                  }\n              ]\n}\n{\n    \"Status\":  true,\n    \"NodeName\":  \"DHCP\",\n    \"Tests\":  [\n                  {\n                      \"TestResult\":  [\n\n                                     ],\n                      \"Result\":  true,\n                      \"Name\":  \"Bits Service test\"\n                  }\n              ]\n}\n```\n\n\n## Initial PSRemotely setup\n\n```powershell\n# One time setup\n    # Download the repository\n    # Unblock the zip\n    # Extract the PSRemotely folder to a module path (e.g. $env:USERPROFILE\\Documents\\WindowsPowerShell\\Modules\\)\n\n    #Simple alternative, if you have PowerShell 5, or the PowerShellGet module:\n        Install-Module PSRemotely\n\n# Import the module.\n    Import-Module PSRemotely    # Alternatively, Import-Module \\\\Path\\To\\PSRemotely\n\n# Get commands in the module\n    Get-Command -Module PSRemotely\n\n# Get help for the module and a command\n    \n    Get-Help Invoke-PSRemotely -full\n```\n## More Information\n\nThe [PSRemotely docs](http://psremotely.readthedocs.io/) will include more information, including :\n\n* PSRemotely Basics\n* PSRemotely Examples\n* PSRemotely How Tos\n\n## Notes\n\nThanks goes to :\n\n- [Remotely project](https://github.com/PowerShell/Remotely) \n- [Ravikanth Chaganti](https://twitter.com/ravikanth) - For all the help with the ideas and motivation behind the scenes.\n- Warren Frame's [PSDeploy module ](https://github.com/RamblingCookieMonster/PSDeploy) - have been following Warren's module \u0026 documentation structure to organize.\n- [Pester module] (https://github.com/pester/pester), PSDesiredStateConfiguration module for borrowing some of the ideas.\n- PowerShell community \u0026 fellow MVPs, who are fantastic at helping each other.\n\n## TO DO \n\nPSRemotely in its current form works for our needs to validate some of the Engineered solutions.\nBut it has the potential to grow into something bigger, below are some of the items in the wishlist :\n\n- Use PowerShell classes, and add support for providers for nodes running either On-prem or on Cloud (AWS or Azure).\n- Integrate with JEA, since PSRemotely uses PSSession endpoints these can be locked down using JEA on the nodes.\n- More unit tests, lacking far behind in this aspect. More focus on it once we start working with the classes implementation.\n- Faster background processing of the remote node jobs, using runspaces.\n\nFeel free to submit any ideas, bugs or pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexterposh%2Fpsremotely","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdexterposh%2Fpsremotely","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexterposh%2Fpsremotely/lists"}