This simple PowerShell module is for turning on/off a single color LED.
This showcases GPIO functionality of the Microsoft.PowerShell.IoT module.
Hardware pieces:
- Breadboard (Optional)
- Male to female jumper wires
- 1 270-330Ω resistor
- A single-color LED
Installation instructions can be found here.
sudo pwsh
Install-Module -Name Microsoft.PowerShell.IoT
git clone https://github.com/PowerShell/PowerShell-IoT.git
Import-Module ./PowerShell-IoT/Examples/Microsoft.PowerShell.IoT.LED
# Turn LED on
Set-Led -Pin 1 -State On
# or
Set-Led 1 On
# or
[PSCustomObject]@{Pin=1; State="On"} | Set-Led
# Turn LED off
Set-Led 1 Off