-
Notifications
You must be signed in to change notification settings - Fork 28
Get-I2CRegister or Set-I2CRegister crash PowerShell if device is unreachable #29
Comments
Yep, this looks like a PowerShell bug. PowerShell should never crash. Can you supply the exception that is spit out? Or is the first message all you get? |
The first message is all I get. |
Interesting. Ok! Let me see if I can get a little bit more info during a repro and then we'll move this over to PowerShell/PowerShell as I doubt we'll be able to catch the exception. Once we're able to do so, we can handle a |
This could also be aproblem with .NET Core itself. |
I can apparently replicate this (or at least a very similar) issue on PowerShell 6.1.0-preview.1, and version 0.1.1 of the Microsoft.PowerShell.IoT module. The same error described above by @jnury happens if I try to get the register, but I get a different error just getting the device. Import-Module Microsoft.PowerShell.IoT
Get-I2CDevice -Id 0x46 #where 0x46 is the correct ID of my device pwsh will crash and throw the error Interestingly, if I do a Also, you can crash all the way out of pwsh another way that I found out by accident while verifying the last point. Import-Module Microsoft.PowerShell.IoT
Get-I2CDevice -Id 911 #Or some other value that isn't valid pwsh will crash, throwing the error |
Thanks for the info @ThmsRynr! |
Original PS crash with |
@anmenaga Can we open an issue on them? Honestly, it sounds like an easy enough fix that we could even contribute back 👍 |
Hi,
If the device provided to Get or Set-I2CRegister commands is not reachable, PowerShell crash with message:
To reproduce (do not connect anything on I2C bus):
PowerShell version:
The text was updated successfully, but these errors were encountered: