PowerShell / PowerShell-IoT

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

Fixed error message about root privileges requirement #38

Closed anmenaga closed 6 years ago

anmenaga commented 6 years ago

This PR fixes error message in situations when PowerShell/IoT module is Not running with sudo/root.

Previously error message was:

PS /home/pi> Get-GpioPin 3                                                                                                                                                                                                                    
Get-GpioPin : The type initializer for 'Unosquare.RaspberryIO.Pi' threw an exception.

After this fix:

PS /home/pi> Get-GpioPin 3                                                                                                                                                                                                                    
Get-GpioPin : This cmdlet requires PowerShell to be started with root privileges.

Also added basic infra code for resource strings (e.g. error messages).

Fixes #32