PowerShell / PowerShell-IoT

Interact with I2C, SPI & GPIO devices using PowerShell Core!
https://www.powershellgallery.com/packages/Microsoft.PowerShell.IoT
MIT License
129 stars 28 forks source link

Better Error handling for wrong arch and not using sudo #32

Closed TylerLeonhardt closed 6 years ago

TylerLeonhardt commented 6 years ago

Right now the error looks like this:

Get-I2CDevice : The type initializer for 'Unosquare.RaspberryIO.Pi' threw an exception.
At line:1 char:1
+ Get-I2CDevice
+ ~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-I2CDevice], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.IoT.GetI2CDevice

It should say "not supported arch" or "not using sudo"

DanielSSilva commented 6 years ago

I was about to open an issue because of this... Forgot the sudo and was getting this error :(