A tiny PowerShell module that streamlines interacting with touch sensors like this:
This project is built on top of PowerShell IoT in order to interact with the sensor.
This was originally made for PSConf Asia 2018 as a part of my talk "PowerShell IoT: A new frontier for PowerShell".
- Install PowerShell on Raspberry Pi
- Enable PowerShell Remoting (PSRP) over SSH
- Configuring the Azure Pipelines Agent on Linux
NOTE: You need at least version v2.141.0 of the Azure Pipelines agent so you may need to download it from GitHub.
- The Azure Pipelines agent acts as a different user on Linux so you may need to change the permissions of the
pwsh
executable so the agent can executepwsh
. Simply run:
sudo chmod 755 ~/powershell/pwsh
- The link above to enable PowerShell remoting over SSH will only run
pwsh
as non-root. This is a problem because we need to be root in order to interact with hardware on Raspberry Pis. To fix this, you can add a newSubsystem
to yoursshd_config
that looks like this:
Subsystem powershell-sudo sudo /usr/bin/pwsh -sshs -NoLogo -NoProfile
Then to use this subsystem, you can use the -Subsystem
parameter:
Enter-PSSession -HostName pi@192.168.123.123 -Subsystem powershell-sudo