{"id":13620055,"url":"https://github.com/PowerShell/PowerShell-IoT","last_synced_at":"2025-04-14T19:30:48.270Z","repository":{"id":31940434,"uuid":"109427757","full_name":"PowerShell/PowerShell-IoT","owner":"PowerShell","description":"Interact with I2C, SPI \u0026 GPIO devices using PowerShell Core!","archived":true,"fork":false,"pushed_at":"2022-06-08T11:16:24.000Z","size":146,"stargazers_count":131,"open_issues_count":22,"forks_count":28,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-01-21T12:35:57.574Z","etag":null,"topics":["gpio","i2c","netcore","powershell","spi"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/Microsoft.PowerShell.IoT","language":"C#","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/PowerShell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-03T18:06:00.000Z","updated_at":"2024-12-28T09:18:37.000Z","dependencies_parsed_at":"2022-07-08T19:39:08.745Z","dependency_job_id":null,"html_url":"https://github.com/PowerShell/PowerShell-IoT","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShell-IoT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShell-IoT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShell-IoT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShell-IoT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerShell","download_url":"https://codeload.github.com/PowerShell/PowerShell-IoT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248945751,"owners_count":21187379,"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":["gpio","i2c","netcore","powershell","spi"],"created_at":"2024-08-01T21:00:51.632Z","updated_at":"2025-04-14T19:30:47.878Z","avatar_url":"https://github.com/PowerShell.png","language":"C#","readme":"# PowerShell-IoT\n\n[![Build status](https://ci.appveyor.com/api/projects/status/ipvxu77rxb5ou8gb?svg=true)](https://ci.appveyor.com/project/PowerShell/powershell-iot)\n[![Travis](https://img.shields.io/travis/rust-lang/rust.svg?logo=travis)](https://travis-ci.com/PowerShell/PowerShell-IoT)\n[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/Microsoft.PowerShell.IoT.svg)](https://www.powershellgallery.com/packages/Microsoft.PowerShell.IoT/)\n\n\u003e Note: PowerShell IoT is still in Preview\n\nA PowerShell module for interacting with hardware sensors and devices using common protocols: GPIO, I2C \u0026 SPI.\n\n![An SSD1306 displaying \"Hello World from PowerShell\"](https://pbs.twimg.com/media/DV8c8Y3V4Ac7PaH.jpg:small)\n\n## Information\n\n### Goals\n\nThe main goal of this project is to provide a friendly interface for interacting with hardware sensors and devices using PowerShell.\n\nThat said,\nit was built as close to the metal as possible to keep the library broad enough to cover a range of sensors and devices.\n\nThe hope is that this module will be the foundation for other modules that will expose specific cmdlets for interacting with specific sensors and devices.\n\nFor example, a cmdlet stack to turn on a light bulb might be:\n\n```powershell\n\u003e Set-Light On # Your user types this / you make this cmdlet\n\u003e Set-GpioPin -Id 4 -Value High # You use this to make that^ / we make this cmdlet\n\u003e # Our code that makes that^\n```\n\nTo see some examples of modules built on top of PowerShell IoT, see the [Examples folder](/Examples).\n\n### Supported platforms\n\n#### Supported devices\n\n* Raspberry Pi 3\n* Raspberry Pi 2\n\n#### Supported operating systems\n\n* Raspbian Stretch\n\n### Documentation \u0026 Examples\n\nPlease see our [docs folder here](/docs) for an API reference, pin layout and other docs. For examples, checkout our [examples folder](/Examples).\n\n### Dependencies\n\nThis project relies on [.NET Core IoT Libraries](https://github.com/dotnet/iot).\nIt is a .NET library for interacting with Raspberry Pi's IO functionality.\n\n## Installation\n\n### PowerShell Gallery\n\nYou can grab the latest version of PowerShell IoT by running:\n\n```powershell\nInstall-Module Microsoft.PowerShell.IoT\n```\n\nPlease note that since this module works with Hardware, higher privileges are required (run PowerShell with `sudo`, or as `root` user) \n\nThen see the section on [running](#running).\n\nIf you want to write a module that uses PowerShell IoT, include it in the `RequiredModules` field of your module manifest.\n\n### GitHub releases\n\nYou can also manually download the zipped up module from the [releases](https://github.com/PowerShell/PowerShell-IoT/releases).\n\nThen see the section on [running](#running).\n\n### AppVeyor\n\nYou can download the latest CI build from our [AppVeyor build here](https://ci.appveyor.com/project/PowerShell/powershell-iot).\nGo to the latest build, click on either of the images, then click on the artifacts tab.\nFrom there, you can download a zip of the latest CI build.\n\nThen see the section on [running](#running).\n\n### From Source\n\n#### Prerequisites\n\n* [PowerShell Core 6 or greater](https://github.com/PowerShell/PowerShell/releases)\n* [.NET Core SDK 2.0 or greater](https://www.microsoft.com/net/download/)\n* [InvokeBuild](https://www.powershellgallery.com/packages/InvokeBuild/)\n* A supported device like a [Raspberry Pi 3](https://www.raspberrypi.org/) with [PowerShell Core 6 on it](https://github.com/powershell/powershell#get-powershell)\n\n#### Building\n\n_NOTE: You can't build on ARM devices at this time so you will need to build on another machine and copy the build to the device._\n\n1. Clone/download the repo\n2. run `./build.ps1 -Bootstrap` to see if you're missing any tooling\n3. run `./build.ps1` to build\n\nAt this point, you'll notice an `out` folder has been generated in the root of your repo.\nThe project is ready to be deployed to your device.\n\n#### Deploying\n\nWe have included a helper script, `Move-PSIoTBuild.ps1`,\nthat will move the PowerShell IoT build over to your device.\nThis copy uses PSRP over SSH so make sure you're able to connect to your pi this way.\nThe `Microsoft.PowerShell.IoT` module will be copied to your `$env:PSModulePath` on your device.\nHere's an example:\n\n```powershell\nMove-PSIoTBuild.ps1 -Ip 10.123.123.123 # IP address of device\n```\n\nYou can also easily copy examples in the `Examples` folder over using the `-WithExample` flag.\nJust give a list of examples you want to copy over and it will move those to you `$env:PSModulePath` along with `Microsoft.PowerShell.IoT`:\n\n```powershell\nMove-PSIoTBuild.ps1 -Ip 10.123.123.123 -WithExample Microsoft.PowerShell.IoT.Plant,Microsoft.PowerShell.IoT.SSD1306\n```\n\nAlso, with the `-Build` parameter,\nit will build/test/package your project before moving it.\n\n_NOTE: If you'd rather not use the script, simply copy the `out/Microsoft.PowerShell.IoT` to your device to get started._\n\n#### Running\n\nStart PowerShell:\n\n```powershell\npwsh\n```\n\nIf you have the `Microsoft.PowerShell.IoT` module in your PSModulePath:\n\n```powershell\nImport-Module Microsoft.PowerShell.IoT\n```\n\nAlternatively, just import the `.psd1`:\n\n```powershell\nImport-Module /path/to/Microsoft.PowerShell.IoT/Microsoft.PowerShell.IoT.psd1\n```\n\nAt this point you can now mess with the module:\n\n```powershell\nGet-Command -Module Microsoft.PowerShell.IoT\nGet-GpioPin 2 # gets the data from GPIO pin 2\n```\n\n#### Testing\n\nYou can run tests, but they require a particular setup. Here is how you run them:\n\n```powershell\n./build.ps1 -Test\n```\n\nThe setup required:\n\n* For I2C: An [Adafruit BME280 I2C or SPI Temperature Humidity Pressure Sensor](https://www.adafruit.com/product/2652)\n* For GPIO: Bend pins 26 and 22 to touch each other or connect them in some way\n* For SPI:  An [Adafruit LIS3DH Triple-Axis Accelerometer](https://www.adafruit.com/product/2809)\n\nWe currently have a build agent that will deploy PR code onto a test Raspberry Pi and run the tests found in the `test` directory.\n","funding_links":[],"categories":["C# #"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPowerShell%2FPowerShell-IoT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPowerShell%2FPowerShell-IoT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPowerShell%2FPowerShell-IoT/lists"}