resourcemanagement-powershell icon indicating copy to clipboard operation
resourcemanagement-powershell copied to clipboard

Input validation around ID parameter

Open FIMTooler opened this issue 5 years ago • 1 comments

Admittedly, I began using some of the commandlets without reading the wiki or putting much thought into what I was doing. I was attempting to validate the module install was working correctly by the Get-Resource commandlet to perform a simple query. I wrongly supplied an AccountName string to the ID parameter. Obviously there was an error message. However, the message from the MIM Service was something about "requestmessageviolatesprotocol". Looking up this string resulted in only a couple of posts mainly around 2010 RTM and Update 2 which provided no useful information as to the what was really happening.

Outside of my lack of reading the Wiki and passing the correct ResourceID to the ID parameter to begin with, it would be nice to have some validation around the ID parameter to make sure it's a GUID value or a string in a GUID format. A failure of this check would prevent a call being made to the MIM Service and an error message that provides no hint to the actual issue. A much more useful error message could be returned indicating the actual problem.

FIMTooler avatar Jan 21 '21 16:01 FIMTooler

Thanks for the suggestion @FIMTooler, i'll look at adding something in a future release

ryannewington avatar Jan 26 '21 02:01 ryannewington